摘要: Golden PyramidOur Robo-Trio need to train for future journeys and treasure hunts. Stephan has built a special flat model of a pyramid. Now the robots ... 阅读全文
posted @ 2014-08-05 13:00 哲人善思 阅读(221) 评论(0) 推荐(0) 编辑
摘要: Prime Palindrome GolfDo you know how to play Prime Palindrome Golf? You are given a number and your challenge is to find the closest palindromic prime... 阅读全文
posted @ 2014-08-05 10:42 哲人善思 阅读(266) 评论(0) 推荐(0) 编辑
摘要: Min and Max需要处理不同数据类型; 另外*args, 表示的是位置参数, *kwargs表示的是key参数, args的类型为tuple类型, 参数为min(3, 2)时, args为(3, 2), 参数为min([3, 2])时, args为([3, 2], );列表解析为[i for ... 阅读全文
posted @ 2014-08-05 10:28 哲人善思 阅读(211) 评论(0) 推荐(0) 编辑
摘要: Roman numerals罗马数字的题目, 注意几个关键的数字即可: (100, 400, 500, 900) -> ('C', 'CD', 'D', 'CM'); (10, 40, 50, 90)->('X', 'XL', 'L', 'XC') 1 def checkio(data): 2 ... 阅读全文
posted @ 2014-08-05 10:27 哲人善思 阅读(341) 评论(0) 推荐(0) 编辑
摘要: How to find friends思路简单,编码不易 1 def check_connection(network, first, second): 2 link_dictionary = dict() 3 4 for link in network: 5 dr... 阅读全文
posted @ 2014-08-05 10:22 哲人善思 阅读(190) 评论(0) 推荐(0) 编辑
摘要: Pawn Brotherhood 1 alpha_table = "abcdefgh" 2 3 def safe_pawns(pawns): 4 safe_count = 0 5 6 for spawn in pawns: 7 if spawn[1] == '1'... 阅读全文
posted @ 2014-08-05 10:20 哲人善思 阅读(427) 评论(0) 推荐(0) 编辑
摘要: The Flat Dictionary原来的代码没处理dict为空的情况 1 def flatten(dictionary): 2 #[] is a list 3 #() is a tuple 4 stack = [((), dictionary)] 5 6 res... 阅读全文
posted @ 2014-08-05 10:08 哲人善思 阅读(205) 评论(0) 推荐(0) 编辑
摘要: Speech Module 1 FIRST_TEN = ["one", "two", "three", "four", "five", "six", "seven", 2 "eight", "nine"] 3 SECOND_TEN = ["ten", "eleven", "... 阅读全文
posted @ 2014-08-05 09:35 哲人善思 阅读(230) 评论(0) 推荐(0) 编辑
摘要: Xs and Os Referee 1 def checkio(game_result): 2 winner = 'D' 3 4 for row in game_result: 5 if row[0] == row[1] == row[2] and row[0] !... 阅读全文
posted @ 2014-08-05 09:34 哲人善思 阅读(375) 评论(0) 推荐(0) 编辑
摘要: The Most Wanted LetterYou are given a text, which contains different english letters and punctuation symbols. You should find the most frequent letter... 阅读全文
posted @ 2014-08-05 09:26 哲人善思 阅读(351) 评论(0) 推荐(0) 编辑
摘要: Non-unique ElementsYou are given a non-empty list of integers (X). For this task, you should return a list consisting of only the non-unique elements ... 阅读全文
posted @ 2014-08-05 09:25 哲人善思 阅读(340) 评论(0) 推荐(0) 编辑
摘要: Absolute sortLet's try some sorting. Here is an array with the specific rules.The array (a tuple) has various numbers. You should sort it, but sort it... 阅读全文
posted @ 2014-08-05 09:24 哲人善思 阅读(273) 评论(0) 推荐(0) 编辑
摘要: Common WordsLet's continue examining words. You are given two string with words separated by commas. Try to find what is common between these strings.... 阅读全文
posted @ 2014-08-05 09:23 哲人善思 阅读(323) 评论(0) 推荐(0) 编辑
摘要: The end of otherFor language training our Robots want to learn about suffixes.In this task, you are given a set of words in lower case. Check whether ... 阅读全文
posted @ 2014-08-05 09:22 哲人善思 阅读(147) 评论(0) 推荐(0) 编辑