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.
I dont think its O(n^2) because there is only ever 2 numbers in this problem. so I think its maximum O(2n) and minimum O(n).
set is unique but this is still n**2 - function is dead for 50K numbers repeated 10 times each in 500K array
timeit shows for other solutions (not the best) about 70ms avg time (which still could be improved)
set is unique but this is still n**2 - function is dead for 50K numbers repeated 10 times each in 500K array
timeit shows for other solutions (not the best) about 70ms avg time (which still could be improved)
This comment is hidden because it contains spoiler information about the solution
set is like a fun that if any elem is repeated it will del it so he will ran the loop 2 times not like 10 or something and it can be more than 2 but cuz there is just 2 kine of numbers in the same list it will get 2 and the repeated one will get del
thx dude ^^
This comment is hidden because it contains spoiler information about the solution
It's so simple. Good work!