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.
Indeed, it is much simpler than it seemed at first, I managed to solve it, thanks for the reply.
Hi - your current approach is basically a brute force search (it is trying all possible combinations of subarrays effectively), so it will indeed get the correct solution.
However, the large random tests involve
lists
with up to50,000
elements - if you perform the brute force approach you will therefore need to perform50,000 ** 2
operations approximately, for each test, which is a huge number.That's why you are timing out; your solution is correct, but inefficient.
To answer your question for advice about this; you cannot really speed up your current brute force approach - instead, you need to reduce the time complexity from O(n^2) to something less than O(n^2).
I have the same problem as @eshis with python, everything seems to work excluding last random test.
This comment is hidden because it contains spoiler information about the solution
Use the Round clause to round the percent_growth column.
This comment is hidden because it contains spoiler information about the solution