![](https://img-blog.csdnimg.cn/20201014180756724.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
Codewars
文章平均质量分 74
1000sakura
https://home.cnblogs.com/u/1000sakura/
展开
-
【Codewars】Multiply
Codewars里的注册题。没有完成这道题就不能注册账号。题目说明:The code does not execute properly. Try to figure out why.解题方法:public class Multiply { public static Double multiply(Double a, Double b) { ret...原创 2019-05-03 21:45:02 · 463 阅读 · 0 评论 -
【Codewars】Pick peaks
Codewars里的 5kyu Kata。题目说明:In this kata, you will write a function that returns the positions and the values of the "peaks" (or local maxima) of a numeric array.For example, the arrayarr = [0, ...原创 2019-05-30 22:17:48 · 353 阅读 · 0 评论 -
【Codewars】Is a number prime?
Codewars里的 6kyu Kata。题目说明:Description:Define a function that takes an integer argument and returns logical valuetrueorfalsedepending on if the integer is a prime.Per Wikipedia, a prime nu...原创 2019-05-30 22:12:35 · 837 阅读 · 0 评论 -
【Codewars】Find The Parity Outlier
Codewars里的 6kyu Kata。题目说明:You are given an array (which will have a length of at least 3, but could be very large) containing integers. The array is either entirely comprised of odd integers or e...原创 2019-05-30 22:02:21 · 282 阅读 · 0 评论 -
【Codewars】Simple Pig Latin
Codewars里的 5kyu Kata。题目说明:Move the first letter of each word to the end of it, then add "ay" to the end of the word. Leave punctuation marks untouched.ExamplespigIt('Pig latin is cool'); // ...原创 2019-05-30 21:55:40 · 495 阅读 · 0 评论 -
【Codewars】Valid Braces
Codewars里的 6kyu Kata。题目说明:Write a function that takes a string of braces, and determines if the order of the braces is valid. It should returntrueif the string is valid, andfalseif it's inval...原创 2019-05-18 16:12:30 · 438 阅读 · 0 评论 -
【Codewars】The Supermarket Queue
Codewars里的 6kyu Kata。题目说明:There is a queue for the self-checkout tills at the supermarket. Your task is write a function to calculate the total time required for all the customers to check out!...原创 2019-05-18 15:52:50 · 750 阅读 · 0 评论 -
【Codewars】Shortest Word
Codewars里的 7kyu Kata。题目说明:Simple, given a string of words, return the length of the shortest word(s).String will never be empty and you do not need to account for different data types.使用双指针解...原创 2019-05-18 15:22:33 · 394 阅读 · 0 评论 -
【Codewars】Data Reverse
Codewars里的 6kyu Kata。题目说明:Description:A stream of data is received and needs to be reversed.Each segment is 8 bits long, meaning the order of these segments needs to be reversed, for example:...原创 2019-05-27 18:28:37 · 312 阅读 · 0 评论 -
【Codewars】Multi-tap Keypad Text Entry on an Old Mobile Phone
Codewars里的 6kyu Kata。题目说明:Description:Prior to having fancy iPhones, teenagers would wear out their thumbs sending SMS messages on candybar-shaped feature phones with 3x4 numeric keypads.---...原创 2019-05-27 16:02:19 · 534 阅读 · 0 评论 -
【Codewars】All Inclusive?
Codewars里的 7kyu Kata。题目说明:Description:Input:a stringstrng an array of stringsarrOutput of functioncontain_all_rots(strng, arr) (or containAllRots or contain-all-rots):a booleantrueif...原创 2019-05-27 15:23:25 · 346 阅读 · 0 评论 -
【Codewars】Integers: Recreation One
Codewars里的 5kyu Kata。题目说明:Divisors of 42 are : 1, 2, 3, 6, 7, 14, 21, 42. These divisors squared are: 1, 4, 9, 36, 49, 196, 441, 1764. The sum of the squared divisors is 2500 which is 50 * 50, a ...原创 2019-05-27 15:16:30 · 325 阅读 · 0 评论 -
【Codewars】Maximum subarray sum
Codewars里的 5kyu Kata。题目说明:The maximum sum subarray problem consists in finding the maximum sum of a contiguous subsequence in an array or list of integers:Max.sequence(new int[]{-2, 1, -3, 4, ...原创 2019-05-20 17:11:13 · 393 阅读 · 0 评论 -
【Codewars】Folding your way to the moon
Codewars里的 7kyu Kata。题目说明:Have you heard about the myth thatif you fold a paper enough times, you can reach the moon with it? Sure you do, but exactly how many? Maybe it's time to write a progra...原创 2019-05-20 16:57:50 · 279 阅读 · 0 评论 -
【Codewars】Build a pile of Cubes
Codewars里的 6kyu Kata。题目说明:Your task is to construct a building which will be a pile of n cubes. The cube at the bottom will have a volume of n^3, the cube above will have volume of (n-1)^3 and so...原创 2019-05-03 22:17:56 · 549 阅读 · 0 评论 -
【Codewars】Abbreviate a Two Word Name
Codewars里的 8kyu Kata。题目说明:Write a function to convert a name into initials. This kata strictly takes two words with one space in between them.The output should be two capital letters with a dot...原创 2019-05-03 21:53:06 · 425 阅读 · 0 评论 -
【Codewars】Bouncing Balls
Codewars里的 6kyu Kata。题目说明:A child is playing with a ball on the nth floor of a tall building. The height of this floor,h, is known.He drops the ball out of the window. The ball bounces (for ex...原创 2019-05-31 21:00:19 · 1036 阅读 · 1 评论