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 be the first word (not 0).
If the input String is empty, return an empty String. The words in the input String will only contain valid consecutive numbers.
For an input: "is2 Thi1s T4est 3a" the function should return "Thi1s is2 3a T4est"
your_order("is2 Thi1s T4est 3a")
[1] "Thi1s is2 3a T4est"
'매일매일개발 > Codewars' 카테고리의 다른 글
codewars #48 A Rule of Divisibility by 13 (6kyu) (0) | 2018.05.24 |
---|---|
codewars #47 String repeat (8kyu) (0) | 2018.05.23 |
codewars #45 Sort - one, three, two (5kyu) (0) | 2018.05.21 |
codewars #44 Bouncing Balls (6kyu) (0) | 2018.05.18 |
codewars #42 Delete occurrences of an element if it occurs more than n times (6kyu) (0) | 2018.05.16 |