- 博客(17)
- 收藏
- 关注
原创 [6 kyu] Multi-tap Keypad Text Entry on an Old Mobile Phone
Prior to having fancy iPhones, teenagers would wear out their thumbs sending SMS messages on candybar-shaped feature phones with 3x4 numeric keypads.------- ------- ------- -------| | | AB...
2020-03-13 09:21:57 301
原创 [5 kyu] Maximum subarray sum
The maximum sum subarray problem consists in finding the maximum sum of a contiguous subsequence in an array or list of integers:maxSequence([-2, 1, -3, 4, -1, 2, 1, -5, 4])# should be 6: [4, -1, ...
2020-03-10 13:04:01 150
原创 [6 kyu] IQ Test
Bob is preparing to pass IQ test. The most frequent task in this test is to find out which one of the given numbers differs from the others. Bob observed that one number usually differs from the othe...
2020-03-10 13:02:56 210
原创 [7 kyu] Categorize New Member
The Western Suburbs Croquet Club has two categories of membership, Senior and Open. They would like your help with an application form that will tell prospective members which category they will be p...
2020-03-10 13:01:05 211
原创 [6 kyu] 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 original order of ...
2020-03-10 12:58:20 116
原创 [6 kyu] Highest Scoring Word
Given a string of words, you need to find the highest scoring word. Each letter of a word scores points according to its position in the alphabet: a = 1, b = 2, c = 3 etc.You need to return the hi...
2020-03-10 12:57:10 246
原创 [6 kyu] Are they the "same"?
Given two arrays a and b write a function comp(a, b) (compSame(a, b) in Clojure) that checks whether the two arrays have the “same” elements, with the same multiplicities. “Same” means, here, that th...
2020-03-10 12:55:43 229
原创 [7 kyu] You're a square!
A square of squaresYou like building blocks. You especially like building blocks that are squares. And what you even like more, is to arrange them into a square of square building blocks!However, s...
2020-03-10 12:49:11 219
原创 [7 kyu] Square Every Digit
Welcome. In this kata, you are asked to square every digit of a number.For example, if we run 9119 through the function, 811181 will come out, because 92 is 81 and 12 is 1.Note: The function a...
2020-03-10 12:45:51 352
原创 [6 kyu] Sort the odd
You have an array of numbers. Your task is to sort ascending odd numbers but even numbers must be on their places.Note: Zero isn’t an odd number and you don’t need to move it. If you have an emp...
2020-03-10 12:43:47 188
原创 [8 kyu] Remove First and Last Character
It’s pretty straightforward. Your goal is to create a function that removes the first and last characters of a string. You’re given one parameter, the original string. You don’t have to worry with st...
2020-03-10 12:40:56 200
原创 [7 kyu] Disemvowel Trolls
Trolls are attacking your comment section! A common way to deal with this situation is to remove all of the vowels from the trolls’ comments, neutralizing the threat.Your task is to write a functi...
2020-03-09 23:17:40 232
原创 [6 kyu] Duplicate Encoder
The goal of this exercise is to convert a string to a new string where each character in the new string is “(” if that character appears only once in the original string, or “)” if that character app...
2020-03-09 23:14:48 170
原创 [6 kyu] Who likes it?
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 should be displayed next to such an item.I...
2020-03-09 23:12:34 137
原创 [6 kyu] Your order, please
Your task is to sort a given string. Each word in the string will contain a single number. This number is the position the word should have in the result.Note: Numbers can be from 1 to 9. So 1 will ...
2020-03-09 23:09:43 242
原创 [7 kyu] Exes and Ohs
Check to see if a string has the same amount of 'x’s and 'o’s. The method must return a boolean and be case insensitive. The string can contain any char.Examples input/output:XO("ooxx") => tr...
2020-03-09 23:07:17 226
原创 [8 kyu] Multiply
The question is for register the webpage. With just a simple describe to let you find the mistake and change it.The code does not execute properly. Try to figure out why.The solution is :def mult...
2020-03-09 23:04:14 245
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人