Today, an interviewer asked me this question. My immediate response was that we could simply do a linear search, comparing the current element with the previous element in t
public static int DuplicateBinaryFind(int[] arr, int left, int right)
{
int dup =0;
if(left==right)
{
dup = left;
}
else
{
int middle = (left+right)\2;
if(arr[middle]