public int search(int[] nums, int target) {

if(nums.length ==0) return -1;

return binary(nums, target,0, nums.length);

}

public int binary(int[] nums, int target, int start, int end) {

if (start >=end) return -1;

int median = (start+ end)/2;

if (nums[median] == target) return median;

return Math.max (binary( nums, target, start, median), binary( nums, target, median +1, end));

}