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.
do some googling about time complexity. If you don't understand that, you won't be able to solve many problmes here (especially "why" you cannot solve them)
What's that mean i can't understand. can you pls explain that.
that has nothing to do with the current problem. Copying the array at the beginning of the function is O(n) step. The next part of the solution is still O(n²).
Well, you couldn't try it earlier since it timed out. Something else about your code is wrong, inspect it carefully.
This comment is hidden because it contains spoiler information about the solution
Here's the prob. In some cases, you'll need to copy the array but in this case you don't. Just change it to
ls
.This has been asked multiple times already. You can't see the original posts (because they contain spoilers) but they are all the same - people are implementing
O(n^2)
solutions when anO(n)
one is required. Your approach is wrong.Thanks, I'll take a look.
Note: Please wrap code with three backticks to format it.
This comment is hidden because it contains spoiler information about the solution
This comment is hidden because it contains spoiler information about the solution
thanks steffan, can i send you the code which i have written so that i can come to know what is inefficient. with this i would learn what i have to do for efficient coding. I will appreciate that.
thanks
jaspal
That means your code is not efficient enough. It runs at least 100 tests, so you need to write efficient code (that runs fast).
Also, next time mark your question as a "question" because it is one. :)
Hi
when i try to attempt this kata i am getting this issue 'Execution Timed Out (12000 ms)'
can anyone help me please.
thanks