Saturday, March 3, 2012

First Duplicate element in an array

There is a size-N array of integers whose values range from 1 to N. Some integers are duplicated. Find the first duplicate and its index without using any extra memory (not even O(1)).

1 comment:

  1. http://codesam.blogspot.in/2011/04/find-first-duplicated-integer-in-array.html

    ReplyDelete