Setup
It has officially been decided that numbers that end with zeroes are boring. They might be fun in your world, but definitely not h...
For further actions, you may consider blocking this person and/or reporting abuse
Recursive Haskell solution
Does this work when passing
0
as argument?Good catch, guess I missed that case. Updated it.
I find it interesting that every solution here uses strings, here's one acting on the numbers itself. (tested against the above and other values).
Javascript
I just realized the function returns undefined when it's not 0 so let me try to fix that real quick lol
codepen
Can someone tell my why the recursion I tried to do didn't work?
I guess you just need to add a 'return' in front of
The code will be--
Yep, that does it. Thanks!
Elixir
Elixir with recursion:
Elixir without recursion, inspired by @avalander 's solution:
Haskell
And the output:
C++
Python one liner
C#
and Dart
Felt like a bit of recursion is always fun to do.
And I couldn't remember when I used extensions in C# last...
Project on GitHub
A Dart solution using TDD :
Elm
Ruby
Regex
Recursion
TESTS
Nice solution :)
Take a loot at
strip
method fromstr
objects;dev.to/rafaacioly/comment/m1ib
TypeScript
Javascript
Python solution 🐍
Java with recursion
Python