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.
This comment is hidden because it contains spoiler information about the solution
Using this solution you should worry about negative values, so it might be worth also checking for that
What if the best sub sequence starts not from index 0 ?
Not, for 34 i domt have to go to 17, its enough to go up to 5 or so.
100 is an example. For n = 34 you need go through (n / 2): 1, 2, 17 and finally N.
Why go to n/2? There's no need to go to n/2, you can get all divisors of 100 if you go up to 10, no need to go to 50.
Why not using (n / 2) in 'for-cycle' for comparing current value of 'i'?
For example, all integer divisors of 10 end at '5' (half of N), also as all inetegr divisors of 100 end at '50' (also half of N).
No need to go through all numbers from 'N / 2' to 'N'.
I think shift is too expensive to use, better use pop
nice one, pretty good job.
i like this scructure. i tried to fit mine in 1 line XD
i started solving this and immediately my mind started thinking recursion idk why.
You are checking the lengths 4 times for no reason
why though ?
Nice solution but mine better haha :)
like seriously speaking me too. he's really clever
Loading more items...