PHP transtations ready! Please, approve.
"Simple and clean, is the way that you make me feel tonight..."
Very few ones had it, pal.
Não tinha me lembrado desse metódo.
Added a test with 0. Invalid inputs are not mentioned or tested anywhere.
If only I knew this method existed lmao!
This is pass by value (primative int type), so it's not mutating the original external variable, only the value within the function. I see no great harm in changing it's value internally within such a small function since the algorithm does not require retaining the original value of n.
i did it in Xcode Playgorund in a min...but here i saw "ERROR"
Nice kata! Thanks for fun!
No tests with superfluous character at the beginning/end of the string.
better use to valueOf()
Looking at the tests, a valid solution for 316 would be '3*100+1*10+6'.
It would make more sense if the actual solution would b '3*100+10+6'
My ruby translation (above) includes a hopefully clearer description, in case you approve it :-)
Ruby translation kumited, including an updated description -- please check and approve (note: author is inactive)