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
This comment is hidden because it contains spoiler information about the solution
I tried to think about an iterative solution to this, but I couldn't. I guess that's ChatGPT's work to do (it told me to just simulate the recursion in a while loop but I'm too lazy to do it).
now it doesnt pass bruh
I think it's worth mentioning that O(n) and O(2n) are «technically» the same time complexity. Obviously O(2n) is worse than O(n), but in terms of big O notation, they're both linear, so they're the same thing.
and he sacrificed the space complexity!
same thing as drhrich but you avoid subtracting 1 to len(num)-y by passing 1 to enumerate (enumerate has a parameter "start" to start the enumeration at that number)
Sadly, this is slower than other solutions. Other than that, good golfing :p
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
its a 7 kyu challenge, wdym?
even better, bro made a snake in python
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
this is horrible af 🤮
Loading more items...