Assumptions:The array is sorted.  There is only one duplicate.  The array is only populated with numbers [0, n], where n is the length of the array.  Example array: [0,1,2,3,4,5,6,7,8,8,9]    Here is my implementation: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]<middle)        {          dup = DuplicateBinaryFind(arr,left, middle-1);        }        else        {           dup = DuplicateBinaryFind(arr, middle+1, right);        }   }   return dup;}Is this considered as good solution to the problem as it finds the duplicate in \$O(\log n)\$?
Find the duplicate in a sorted array In less-than O(n)
c#;algorithm;binary search