- 博客(16)
- 收藏
- 关注
原创 Codewars--Basic DeNico
Basic DeNicoClick here to get the problem!ProblemMy Solution:def de_nico(key,msg): #key_sort = sorted(key) key_sort = "".join((lambda x:(x.sort(),x)[1])(list(key))) msgs = list(len(ms...
2019-04-11 21:54:58
239
原创 codewars--Primes with Even Digits
Codewars–Stay away for many daysProblem Description:点击此处获取题目Find the closest prime number under a certain integer n that has the maximum possible amount of even digits.For n = 1000, the highest pr...
2019-01-12 21:36:49
343
原创 codewars--How Many Numbers? II
How Many Numbers? IIClick here to get problem.Problem Description:We want to find the numbers higher or equal than 1000 that the sum of every four consecutives digits cannot be higher than a certai...
2019-01-06 01:49:10
420
原创 codewars--Identifying Top Users and their Corresponding Purchases On a Website
Identifying Top Users and their Corresponding Purchases On a WebsiteProblem Description:Click here to get the problem description.Version of Python:Solution:sum=[]dict={}def id_best_users(*a...
2019-01-04 20:48:53
386
原创 Codewars--How many numbers III?
How many numbers III?Problem Description:We want to generate all the numbers of three digits that:the value of adding their corresponding ones(digits) is equal to 10.their digits are in increasin...
2018-12-25 20:53:01
848
原创 Codewars--Phone Directory
Phone DirectoryFinally, I got it!Problem Description:John keeps a backup of his old personal phone book as a text file. On each line of the file he can find the phone number (formated as +X-abc-de...
2018-12-24 16:43:30
680
转载 Codewars--String Mix
String MixProblem Description:Given two strings s1 and s2, we want to visualize how different the two strings are. We will only take into account the lowercase letters (a to z). First let us count ...
2018-12-18 16:26:03
937
原创 Codewars--Prefill an Array
Prefill an ArrayProblem Description:Create the function prefill that returns an array of n elements that all have the same value v. See if you can do this without using a loop.You have to validate...
2018-12-18 15:58:21
249
原创 Codewars--Format a string of names like 'Bart, Lisa & Maggie'.
Format a string of names like ‘Bart, Lisa & Maggie’.Problem Description:Given: an array containing hashes of namesReturn: a string formatted as a list of names separated by commas except for t...
2018-12-14 16:00:04
590
原创 Codewars--Unary function chainer
Unary function chainerProblem Description:Your task is to write a higher order function for chaining together a list of unary functions. In other words, it should return a function that does a left ...
2018-12-14 10:21:46
306
原创 Codewars--Who likes it?
Codewars–Who likes it?Problem Description:You probably know the “like” system from Facebook and other pages. People can “like” blog posts, pictures or other items. We want to create the text that sh...
2018-12-13 21:22:46
710
原创 Codewars--Persistent Bugger
Persistent BuggerProblem Description:Write a function, persistence, that takes in a positive parameter num and returns its multiplicative persistence, which is the number of times you must multiply ...
2018-12-13 21:03:02
464
原创 Codewars--Fold an array
Fold an arrayProblem Description:As you see, if the count of numbers is odd, the middle number will stay. Otherwise the fold-point is between the middle-numbers, so all numbers would be added in a...
2018-12-13 13:43:48
284
原创 Codewars--Delete occurrences of an element if it occurs more than n times
Delete occurrences of an element if it occurs more than n timesDescrition of Problem:Enough is enough!Alice and Bob were on a holiday. Both of them took many pictures of the places they’ve been, a...
2018-12-12 21:20:49
423
原创 Codewars--Rectangle into Squares
Codewars–the fourth dayRectangle into Squaresproblem describtionThe drawing below gives an idea of how to cut a given “true” rectangle into squares (“true” rectangle meaning that the two dimension...
2018-12-12 20:19:38
412
原创 codewars--Sum of Digits
Codewars---第三天Sum of Digits / Digital Rootproblem describtion:Method:Explain:Sum of Digits / Digital Rootproblem describtion:In this kata, you must create a digital root function.A digital root is...
2018-12-12 19:19:41
320
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅