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.
Oh nice!Didn't realise python had this swapping functionality built in.
Damn...i forgot about the mathematical way to calculate the sum.Nice one!
This comment is hidden because it contains spoiler information about the solution
What a terrible solution now that i think of it -_-
This challenge has been bugging me for MONTHS,and i learned a lesson after solving it by getting a hint on how it should be solved.
This is a very clever solution man elegant performant and clever!Bravo!
I think this is overengineering the problem a bit :/
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.
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
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
Loading more items...