Python HackerRank|The Minion Game
来源:互联网 发布:软件需求 功能需求 编辑:程序博客网 时间:2024/06/09 20:27
- Dashboard
- Python
- Strings
- The Minion Game
def minion_game(string): vowels = 'AEIOU' Stuart = 0 Kevin = 0 length = len(string) for i in range(length): if string[i] in vowels: Kevin += (length - i) else: Stuart += (length - i) # For example, BANANA, 'B'(s[0]) not in vowels, so B, BA, BAN, BANA, BANAN, BANANA, altogether 6(length - 0), are all we need. if Stuart > Kevin: print('Stuart', Stuart) elif Stuart < Kevin: print('Kevin', Kevin) else: print('Draw') if __name__ == '__main__': s = input() minion_game(s)
0 0
- Python HackerRank|The Minion Game
- [HackerRank 101 Hack 51] Testing the Game
- Python HackerRank|The Captain's Room
- HackerRank: Bricks Game
- Hackerrank - Game Of Rotation 题解
- 【HackerRank】 Game Of Thrones - I
- Hackerrank Cut the sticks
- HackerRank The Maximum Subarray
- Hackerrank Connect the country
- Bricks Game(HackerRank play-game)
- HackerRank - Python部分
- Python HackerRank|Lists
- saltstack 执行cp.get_file没有反应,salt-minion-The Salt Master has rejected this minion's
- hackerrank The Love-Letter Mystery
- Hackerrank Sherlock and The Beast
- Cut the tree _ HackerRank
- [Hackerrank] The Coin Change Problem
- hackerrank The Time in Words
- Java IO字节输出流常见类进行分析(三)
- Android 5.0以下XML定义的drawable不识别?attr/属性的解决思路
- A very hard Aoshu problem HDU-4403
- TCP在握手、挥手或连接已建立时,如果发生意外会怎样?
- W3C 不要再使用废弃的 HTML 标签
- Python HackerRank|The Minion Game
- html5+js拖拽上传
- 浅谈什么是MVC设计模式
- ACM 海贼王之伟大航路(深搜剪枝)
- ubuntu常用命令
- spring setter 方式注入
- 第一个Android程序
- PAT 1052
- 解除oacle锁住的表sql