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.
Your solution is also bad) Use division % instead of pow
Hi there Saladin,
I don't see a way to avoid the division. That is a mathematical necessity as far as I understand. If it where base two and not base 10 the right shift operateion replaces the division, but as the task is in base 10 I dont think there is any way of avoiding that.
Hey Phylex,
I see your solution now, and it does make sense to do this instead of converting the integer into a vec of numbers. did you also think of trying to avoid dividing?
Kind regards,
Saladin
This is my solution
https://www.codewars.com/kata/reviews/5e42dbd090bbd20001e5810f/groups/5e922e91955e440001a508b1
I see your point. What's your solution then?
I thought of this solution but it feels a bit resource intensive to transform the whole thing into a string and let the string function do the conversion implicitly and then explicitly reconvert the string to an integer. Yes it is nice to write, but it depends on a lot of the std library and cant be run on embedded systems (muC). It does use many language paradigms, so that's kinda cool