join53 Mumbling Description: This time no story, no theory. The examples below show you how to write function accum: Examples: accum("abcd") -> "A-Bb-Ccc-Dddd" accum("RqaEzty") -> "R-Qq-Aaa-Eeee-Zzzzz-Tttttt-Yyyyyyy" accum("cwAt") -> "C-Ww-Aaa-Tttt" The parameter of accum is a string which includes only letters from a..z and A..Z. Solution: 1. Extract each character from a string with an index. 2. Characters ar.. 2022. 4. 27. Two to One Description: Take 2 strings s1 and s2 including only letters from ato z. Return a new sorted string, the longest possible, containing distinct letters - each taken only once - coming from s1 or s2. Examples: a = "xyaabbbccccdefww" b = "xxxxyyyyabklmopq" longest(a, b) -> "abcdefklmopqwxy" a = "abcdefghijklmnopqrstuvwxyz" longest(a, a) -> "abcdefghijklmnopqrstuvwxyz" Solution: 1. Concatenate strin.. 2022. 4. 26. Apparently-Modifying Strings Description: For every string, after every occurrence of 'and' and/or 'but', insert the substring 'apparently' directly after the occurrence(s). If input does not contain 'and' or 'but', return the same string. If a blank string, return ''. If substring 'apparently' is already directly after an 'and' and/or 'but', do not add another. (Do not add duplicates). Examples: Input 1 'It was great and I.. 2022. 4. 26. Square Every Digit Description: Welcome. In this kata, you are asked to square every digit of a number and concatenate them. For example, if we run 9119 through the function, 811181 will come out, because 92 is 81 and 12 is 1. Note: The function accepts an integer and returns an integer Solution: 1. Separate the numbers by one digit. 2. Square each of the separated numbers. 3. Return the squared numbers side by si.. 2022. 4. 18. Remove First and Last Character Part Two Description: This is a spin off of my first kata. You are given a string containing a sequence of character sequences separated by commas. Write a function which returns a new string containing the same character sequences except the first and the last ones but this time separated by spaces. If the input string is empty or the removal of the first and last items would cause the resulting string .. 2022. 4. 10. Complementary DNA Description: 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 know more: http://en.wikipedia.org/wiki/DNA In DNA strings, symbols "A" and "T" are complements of each other, as "C" and "G". You function receives one side of the DNA (string, except for Haskell); you need to.. 2022. 3. 31. 이전 1 ··· 4 5 6 7 8 9 다음