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.
Hi Anorey I've actually approached the problem with same way just look at the time complexity it could easily by resolved by o(1)
Hahaha It's way to simple you just need to understand the problem.
solution lies in problem representation and arrangement no loop nothing required.
I was scracthing my head first.
Hey How you solved with single for loop
This is quite good solution if you look code wise but time complexity wise it is not! You're iterating over the same array 3 times.
A Good solution would be with normal for-loop
This comment is hidden because it contains spoiler information about the solution