CodeWar
aka程序皇像隔扣你的勒布朗进入名人堂
这个作者很懒,什么都没留下…
展开
-
CodeWar(JavaScript)---Find the divisors!
Find the divisors!题目:Create a function named divisors/Divisors that takes an integer n > 1 and returns an array with all of the integer’s divisors(except for 1 and the number itself), from smalle...原创 2019-07-24 16:24:38 · 165 阅读 · 0 评论 -
CodeWar(JavaScript)---Vowel Count
Vowel Count题目:Return the number (count) of vowels in the given string.We will consider a, e, i, o, and u as vowels for this Kata.The input string will only consist of lower case letters and/or spa...原创 2019-07-24 16:39:44 · 309 阅读 · 0 评论 -
CodeWar(JavaScript)---Complementary DNA
Complementary DNA题目:Deoxyribonucleic acid (DNA) is a chemical found in the nucleus of cells and carries the “instructions” for the development and functioning of living organisms.If you want to kno...原创 2019-07-24 16:48:52 · 311 阅读 · 0 评论 -
CodeWar(JavaScript)---Sum of Digits / Digital Root
Sum of Digits / Digital Root题目:In this kata, you must create a digital root function.A digital root is the recursive sum of all the digits in a number. Given n, take the sum of the digits of n. If ...原创 2019-07-24 17:06:32 · 312 阅读 · 0 评论 -
CodeWar(JavaScript)---Printer Errors
Printer Errors问题:In a factory a printer prints labels for boxes. For one kind of boxes the printer has to use colors which, for the sake of simplicity, are named with letters from a to m.The colors...原创 2019-07-24 17:18:05 · 252 阅读 · 0 评论 -
CodeWar(JavaScript)---Convert string to camel case
Convert string to camel case问题:Complete the method/function so that it converts dash/underscore delimited words into camel casing. The first word within the output should be capitalized only if the ...原创 2019-07-24 17:25:47 · 253 阅读 · 0 评论 -
CodeWar(JavaScript)---Moving Zeros To The End
Moving Zeros To The End问题:Write an algorithm that takes an array and moves all of the zeros to the end, preserving the order of the other elements.moveZeros([false,1,0,1,2,0,1,3,"a"]) // returns[fa...原创 2019-07-24 17:34:28 · 332 阅读 · 0 评论 -
CodeWar(JavaScript)---Unique In Order
Unique In Order问题:Implement the function unique_in_order which takes as argument a sequence and returns a list of items without any elements with the same value next to each other and preserving the...原创 2019-07-24 17:40:17 · 292 阅读 · 0 评论 -
CodeWar(JavaScript)---Perimeter of squares in a rectangle
Perimeter of squares in a rectangle问题:The drawing shows 6 squares the sides of which have a length of 1, 1, 2, 3, 5, 8. It’s easy to see that the sum of the perimeters of these squares is : 4 * (1 +...原创 2019-07-24 17:47:11 · 298 阅读 · 0 评论