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.
the int conversion i think is unnessesary. in go division returns the same type and in integer case it returns the quotient
No. It will of course depend on the details of the language/compiler/jit you are using, but for the most part in modern computing that kind of optimization is very premature -- the "slow" step is writing a string of ~n^2 characters. The pre-processing you are considering is in linear time, so it is insignificant as n grows large.
Put simpler, if you have an input string of 100 characters, 5049 characters have to one-by-one added to your output string. With an input of 200 chars, you spend 2x as long splitting the string, true, but have to build an output of 20099 chars -- about 4x larger. This is true for every doubling of the input, and is going to be the real boundary for performance.
For more on how SDE's think about performance of algorithms, look up "big O notation".
All that said, to answer the question you actually asked, keeping input as a string is probably a trivial but (at small numbers) measurable gain in efficiency. But at work, my boss would care more about readibility in this case.
This comment is hidden because it contains spoiler information about the solution
The easiest way to find your old code is to go to your own profile and look at the solutions tab.
You might (will?) have to be logged in to view your code.