본문 바로가기

join53

Reverse words 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.. 2022. 3. 28.
Dashatize it Description: Given a variable n, If n is an integer, Return a string with dash'-'marks before and after each odd integer, but do not begin or end the string with a dash mark. If n is negative, then the negative sign should be removed. If n is not an integer, return an empty value. Ex: dashatize(274) -> '2-7-4' dashatize(6815) -> '68-1-5' Solution: 1. If 'n' is not a number, 'None' is returned. 2.. 2022. 3. 22.
Meeting Description: John has invited some friends. His list is: s = "Fred:Corwill;Wilfred:Corwill;Barney:Tornbull;Betty:Tornbull;Bjon:Tornbull;Raphael:Corwill;Alfred:Corwill"; Could you make a program that makes this string uppercase gives it sorted in alphabetical order by last name. When the last names are the same, sort them by first name. Last name and first name of a guest come in the result betwe.. 2022. 3. 17.
+1 Array Description: Given an array of integers of any length, return an array that has 1 added to the value represented by the array. the array can't be empty only non-negative, single digit integers are allowed Return nil (or your language's equivalent) for invalid inputs. Examples For example the array [2, 3, 9] equals 239, adding one would return the array [2, 4, 0]. [4, 3, 2, 5] would return [4, 3,.. 2022. 3. 15.
Abbreviate a Two Word Name Description: 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 separating them. It should look like this: Sam Harris => S.H patrick feeney => P.F solution: 1. Change the name to all uppercase letters. 2. Separate strings based on space and put them in an array. 3. Put the first .. 2022. 3. 6.
Human Readable Time 문제 설명 Write a function, which takes a non-negative integer (seconds) as input and returns the time in a human-readable format (HH:MM:SS) HH = hours, padded to 2 digits, range: 00 - 99 MM = minutes, padded to 2 digits, range: 00 - 59 SS = seconds, padded to 2 digits, range: 00 - 59 The maximum time never exceeds 359999 (99:59:59) You can find some examples in the test fixtures. 해결 방법 1. seconds를 .. 2022. 2. 20.