Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
It's a good implementation, but by nature converting a number into a string is much more complicated than a simple while loop which runs a dozen or so times.
Runtime: O(n)
Space: O(n)
clean but slow
Is this the most time efficient? :D
to_string() is essentially a wrapper for impl Display. I think this is the u64 implementation of it: https://doc.rust-lang.org/src/core/fmt/num.rs.html#199-258 Looks like there is some cost, but I can't speak to how much of it is optimized out in release mode.
Does
to_string
cost much?This solution should exit early and be more efficient than my solution I submitted before this one.