• ###### Davionkcommented on "Find the unique number" java solution

It is not actually. It is more my stupid mistake for saying that in the end of my comment ;P. As you can see the first reply to my comment explains that I am wrong in a funny way :D.

Again sorry for the last part of my comment and thanks for the reply.

• ###### mateenkasimcommented on "Find the unique number" java solution

How is this O(n/2) if you're still doing ~n comparisons? The loop runs n/2 times but you do 2 comparisons per loop. O(n) is still great though, better than sorting

• ###### FArekkusucommented on "Find the unique number" java solution

tecnically speaking it was O(n / 2)

You could improve it drastically by splitting the array into n 1-element-long segments, and have O(n / n) = O(1) time complexity

• ###### Davionkcommented on "Find the unique number" java solution

This is an ok solution. But that's all.
It is the same as all standard solutions, just more nice to the eye.

The kata specifies to give emphasis to efficiency!

Go check my solution, I solved it in O(N). Even though tecnically speaking it was O(N/2), so half the time!!!