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.
One day I will get there - nice one. Well done.
Gave up on my brute-foce solution after many hours failed attemps and timeouts - no google used at the time lol
Would you consider mine solution as cheating?
Thank you for the explanations. I think that I am getting a bit closer to understand all of this.
Trying to understand the complexity here, am I right to think this is quadriatic due to fact that each slice operation time complexity is (omega) O(k). So as we doing two of them it is O(k) * 2 = O(k^2). Then there is iteration cost which is O(n). Not sure if this can be seen as k elements in the list as well therefore with slicing together ending in worst case scenario complexity of O(k^2) * k or O(k^3). Does this make any sense? :-)
Souce of info: https://wiki.python.org/moin/TimeComplexity
Winner solution here in the terms of performance.
I have done some time performance check of the top 5 voted solutions + mine. I knew that mine was horibble but just didn't know the scale of it - now I know lol.
The tests were done with help of "timeit.timeit(func(strength, width), number=10000).
Winner: falsetru with total time of 0.07845971399910923 seconds
Timing break_the_web_mercy_madmask:
Timing break_the_web_theodaizer:
Timing break_the_web_falsetru:
Timing break_the_web_daddepledge:
Timing break_the_web_pavlobarkhayev:
Timing break_the_web_nor_mal: