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.
You can if you start at index 1, like you did, instead of starting at index 0 and checking next element. It doesn't matter.
You could've get rid of the last loop just by multiplying the value of num by k + 1.
Another kata similar to this one? I loved this one.
Don't know much about that, but a pretty basic way to measure times is getting the time before execution then subtract that time to the time after execution, that could give you time execution, "could" because it's not consistent for several reasons, like, it depends on the specs of your device, programs you're running, etcetera, so this is just like an archaic way. Actual pros analyze the time and space complexity of the algorithm as a whole, considering the size of the inputs, cost of each function call, loops, and more stuff, which I don't have any knowledge on those topics.
Ahh HAHAHAHAHAHAHA.
Any tips on the approach? My code times out.
This comment is hidden because it contains spoiler information about the solution
Bro...
Well, respect for spending a lot of time building up your solution.