原创 入坑codewars第16天-Transformation of a Number Through Prime Factorization

題目: Every natural number, n, may have a prime factorization like: We define the geometric derivative of n, as a number

原创 入坑codewars第17天-Directions Reduction

題目: Once upon a time, on a way through the old wild west,… … a man was given directions to go from one point to another

原创 入坑codewars第15天-Regexp Basics - is it IPv4 address?

題目: Implement String#ipv4_address?, which should return true if given object is an IPv4 address - four numbers (0-255)

原创 入坑codewars第14天-Where is my parent!?(cry)

題目: Mothers arranged dance party for children in school.On that party there are only mothers and their children.All are

原创 入坑codewars第12天-Best travel

題目一: John and Mary want to travel between a few towns A, B, C ... Mary has on a sheet of paper a list of distances betw

原创 入坑codewars第13天- Dashatize it

第一題: Given a number, return a string with dash'-'marks before and after each odd integer, but do not begin or end the s

原创 入坑codewars第11天-Clock in Mirror

題目一: Peter can see a clock in the mirror from the place he sits in the office. When he saw the clock shows 12:22 He kno

原创 入坑codewars第九天-Title Case

題目: Title Case A string is considered to be in title case if each word in the string is either (a) capitalised (that is

原创 入坑codewars第八天-Help the bookseller !

今天只寫了一道題不容易呀,實在不懂輸出格式,於是想辦法湊出來的…… 題目: A bookseller has lots of books classified in 26 categories labeled A, B, ... Z. E

原创 入坑codewars第十天-Product of consecutive Fib numbers、longest_palindrome

    題目: The Fibonacci numbers are the numbers in the following integer sequence (Fn): 0, 1, 1, 2, 3, 5, 8, 13, 21, 34,

原创 入坑codewars第七天-Maximum subarray sum、Are they the “same”?

題目: 題意:求連續子序列的和的最大值   思路:笨方法一個一個求:首先求第一個數分別加後面的數取一個最大值 然後下一個數分別加後面的數取最大值 以此類推…… 代碼如下: def maxSequence(arr): maxsu

原创 入坑codewars第六天-Highest Scoring Word、The Supermarket Queue

題目: Given a string of words, you need to find the highest scoring word. Each letter of a word scores points according t

原创 入坑codewars第五天-Dubstep、Regex validate PIN code

第一題: 題目: Polycarpus works as a DJ in the best Berland nightclub, and he often uses dubstep music in his performance. R

原创 入坑codewars第四天-Delete occurrences of an element if it occurs more than n times、Sum of odd numbers

第一題: Enough is enough! Alice and Bob were on a holiday. Both of them took many pictures of the places they've been, an

原创 入坑codewars第二天-Basic Mathematical Operations、Ones and Zeros

  一、題目 需要實現 +對應加法 需要實現 -對應減法 …… 以此類推 二、求解 簡單的if語句 二、題二 題意就是:將列表中的數字看成一串二進制然後轉成十進制數 我的思路是:先把列表顛倒,這裏注意列表a,a.reverse()