top | item 34014083

(no title)

sischoel | 3 years ago

It is indeed O(N). There is also a more efficient algorithm (in case the range is small) that uses binary search to find the first index. Such an algorithm would have time complexity O(log(N) + H) where H is the number of elements in the output.

discuss

order

No comments yet.