일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | |||
5 | 6 | 7 | 8 | 9 | 10 | 11 |
12 | 13 | 14 | 15 | 16 | 17 | 18 |
19 | 20 | 21 | 22 | 23 | 24 | 25 |
26 | 27 | 28 | 29 | 30 | 31 |
- slice
- DART
- LOWER
- Sorted
- enumerate
- len
- If
- FOR
- count
- decorator
- iNT
- Python
- map
- sum
- MAX
- index
- 위코드
- js
- WECODE
- join
- Algorithm
- split
- range
- lambda
- SQL
- and
- STR
- 파이썬
- list
- or
- Today
- Total
목록slice (32)
코드로 우주평화
Description: Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string). Examples: solution('abc', 'bc') # returns true solution('abc', 'd') # returns false Solution: 1. Return True if the last digit of 'string' is the same as 'ending'. 2. If 'ending' is an empty string, return True. 3. If not, return False. def solution(strin..
Description: Create a function that returns the sum of the two lowest positive numbers given an array of minimum 4 positive integers. No floats or non-positive integers will be passed. For example, when an array is passed like [19, 5, 42, 2, 77], the output should be 7. [10, 343445353, 3453445, 3453545353453] should return 3453455. Solution: 1. Find the two smallest numbers. 2. Returns the sum o..
Description: Input : an array of integers. Output : this array, but sorted in such a way that there are two wings: the left wing with numbers decreasing, the right wing with numbers increasing. the two wings have the same length. If the length of the array is odd the wings are around the bottom, if the length is even the bottom is considered to be part of the right wing. each integer l of the le..
Description: Complete the function that accepts a string parameter, and reverses each word in the string. All spaces in the string should be retained. Examples "This is an example!" ==> "sihT si na !elpmaxe" "double spaces" ==> "elbuod secaps" Solution: 1. Separate text based on space. 2. Turn over the separated text and put it in an array. 3. Convert the text in the array to a string with space..
Description: 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 smallest to largest. If the number is prime return the string '(integer) is prime' (null in C#) (use Either String a in Haskell and Result in Rust). Example: divisors(12); #should return [2,3,4,6] divisors(25); #shoul..
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: 11111111 00000000 00001111 10101010 (byte1) (byte2) (byte3) (byte4) should become: 10101010 00001111 00000000 11111111 (byte4) (byte3) (byte2) (byte1) The total number of bits will always be a multiple of 8. The data is given in a..
Description: Born a misinterpretation of this kata, your task here is pretty simple: given an array of values and an amount of beggars, you are supposed to return an array with the sum of what each beggar brings home, assuming they all take regular turns, from the first to the last. For example: [1,2,3,4,5] for 2 beggars will return a result of [9,6], as the first one takes [1,3,5], the second c..
Description: As a part of this Kata, you need to create a function that when provided with a triplet, returns the index of the numerical element that lies between the other two elements. The input to the function will be an array of three distinct numbers (Haskell: a tuple). For example: gimme([2, 3, 1]) => 0 2 is the number that fits between 1 and 3 and the index of 2 in the input array is 0. A..
Description: You are going to be given an array of integers. Your job is to take that array and find an index N where the sum of the integers to the left of N is equal to the sum of the integers to the right of N. If there is no index that would make this happen, return -1. For example: Let's say you are given the array {1,2,3,4,3,2,1}: Your function will return the index 3, because at the 3rd p..
문제 설명 Write a function that takes in a string of one or more words, and returns the same string, but with all five or more letter words reversed (Just like the name of this Kata). Strings passed in will consist of only letters and spaces. Spaces will be included only when more than one word is present. Examples: spinWords( "Hey fellow warriors" ) => returns "Hey wollef sroirraw" spinWords( "This..