매일매일개발/Codewars
codewars #34 Write Number in Expanded Form (6kyu)
개하싶
2018. 5. 3. 20:25
#34 Write Number in Expanded Form
Write Number in Expanded Form
You will be given a number and you will need to return it as a string in Expanded Form. For example:
Kata.expandedForm(12); # Should return "10 + 2"
Kata.expandedForm(42); # Should return "40 + 2"
Kata.expandedForm(70304); # Should return "70000 + 300 + 4"
NOTE: All numbers will be whole numbers greater than 0.