codewars是一个非常好的刷题网站,提供了多种编程语言的在线练习。
codewars中有两个专有名词出现频率比较高:一个是kata,意思是招式,我们可以直接理解成题目;另一个是kyu,意思是段位,这就像打怪玩游戏一样,你破解的kata越多,你的段位就越高,可以享受到晋级的成就感,很容易让人一发而不可收拾。
下面是我刷过的题目和答案,全是用Js代码实现的。
新增了LeetCode目录,有少量LeetCode题目,有时间的话慢慢刷~
- (6kyu) Unique In Order
- (7kyu) Get the Middle Character
- (7kyu) Descending Order
- (6kyu) Sum of Digits / Digital Root
- (6kyu) Which are in?
- (6kyu) IQ Test
- (6kyu) Take a Ten Minute Walk
- (6kyu) Are they the "same"?
- (6kyu) Good vs Evil
- (6kyu) Scramblies
- (6kyu) Find the odd int
- (4kyu) Next bigger number with the same digits
- (4kyu) Twice linear
- (8kyu) Opposite number
- (8kyu) String repeat
- (8kyu) Sum without highest and lowest number
- (8kyu) Remove First and Last Character
- (8kyu) Sum of positive
- (8kyu) Return Negative
- (7kyu) Mumbling
- (7kyu) Vowel Count
- (7kyu) Highest and Lowest
- (7kyu) Complementary DNA
- (7kyu) Jaden Casing Strings
- (8kyu) Even or Odd
- (5kyu) Human Readable Time
- (6kyu) Multiples of 3 or 5
- (6kyu) Decode the Morse code
- (6kyu) Persistent Bugger
- (6kyu) Equal Sides Of An Array
- (6kyu) Playing with digits
- (6kyu) Find The Parity Outlier
- (6kyu) Stop gninnipS My sdroW!
- (6kyu) Your order, please
- (6kyu) Tribonacci Sequence
- (6kyu) Dubstep
- (5kyu) Directions Reduction
- (5kyu) Sum of Pairs
- (7kyu) Shortest Word
- (5kyu) Calculating with Functions
- (5kyu) A Chain adding function
- (5kyu) Weight for weight
- (5kyu) Valid Parentheses
- (7kyu) You're a square!
- (8kyu) Number of People in the Bus
- (7kyu) Exes and Ohs
- (5kyu) Maximum subarray sum
- (8kyu) Will you make it
- (5kyu) Simple Pig Latin
- (7kyu) Disemvowel Trolls
- (7kyu) Square Every Digit
- (6kyu) Who likes it?
- (6kyu) Bit Counting
- (8kyu) Convert number to reversed array of digits
- (5kyu) Convert string to camel case
- (5kyu) Moving Zeros To The End
- (5kyu) Largest 5 digit number in a series
- (6kyu) Array.diff
- (6kyu) Create Phone Number
- (4kyu) Valid Braces
- (6kyu) Counting Duplicates
- (6kyu) Find the divisors!
- (6kyu) Duplicate Encoder
- (6kyu) Format a string of names like 'Bart, Lisa & Maggie'.
- (6kyu) Replace With Alphabet Position
- (6kyu) Is a number prime?
- (6kyu) Build a pile of Cubes
- (5kyu) Where my anagrams at?
- (5kyu) RGB To Hex Conversion
- (3kyu) Hard Time Bomb
- (6kyu) Does my number look big in this?
- (6kyu) Consecutive strings
- (7kyu) Palindrome chain length
- (5kyu) Pete, the baker
- (5kyu) Rot13
- (5kyu) Product of consecutive Fib numbers
- (6kyu) Number Format
- (6kyu) Vasya - Clerk
- (6kyu) Find the missing letter
- (5kyu) Can you get the loop ?
- (5kyu) PaginationHelper
- (6kyu) Delete occurrences of an element if it occurs more than n times
- (6kyu) Title Case
- (6kyu) First non-repeating character
- (6kyu) Build Tower
- (6kyu) WeIrD StRiNg CaSe
- (6kyu) Split Strings
More katas are not listed here. If you want to see it, you can find it directly in the folder...