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.
But of course you're right - the "encoding" used in this solution is terribly inefficient. The solution was meant as a joke, and my suggestion was mostly a joke.
On the other hand - it might be interesting to rewrite the code such that it uses divideAndRemainder() everywhere and reduces the number of expensive BigInteger operations, just to see how much faster it will be.
And in general, in cases where you actually need BigInteger in production code, it's good to know about divideAndRemainder() and its potential for efficiency improvements.
The solution was obviously written by someone who cares about efficiency - the function uses a StringBuilder, not String and +.
I sincerely doubt this solution cares about efficiency
Your solution is pleasant to read.
This comment is hidden because it contains spoiler information about the solution