'''

public class Solution {

public int FindDuplicate(int[] nums) {

for(int i = 0;i<nums.Length;i++){

int val = nums[i];

int index = Math.Abs(val)-1;

if(nums[index]<0){

return index+1;

}else{

nums[index] = -nums[index];

}

}

return -1;

}

}

'''