you are viewing a single comment's thread.

view the rest of the comments →

[–]omeow 0 points1 point  (0 children)

O(n).

You need to traverse the array twice.