This comment is hidden because it contains spoiler information about the solution
it is not O(n). (item-s in ints[i+1:]) also loops underneath
same problem
How so? I just did it with 4 lines.
That's O(n^2). You are looping through to access each number, then you are looping through the entire list at each number to check if it adds up to the target.
You shouldn't reuse an old kata. Make a new one from scratch - that way you don't start at 0% from 2 ;)
membership testing for list is O(n) so what you describe would be O(n*n) maybe that's obvious and you're not doing that.
O(n)
O(n*n)
i completely agree!
Loading collection data...
This comment is hidden because it contains spoiler information about the solution
it is not O(n). (item-s in ints[i+1:]) also loops underneath
same problem
How so? I just did it with 4 lines.
That's O(n^2). You are looping through to access each number, then you are looping through the entire list at each number to check if it adds up to the target.
You shouldn't reuse an old kata.
Make a new one from scratch - that way you don't start at 0% from 2 ;)
membership testing for list is
O(n)
so what you describe would beO(n*n)
maybe that's obvious and you're not doing that.
i completely agree!