public class Solution {

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

```
int length = nums.length;
return check(nums, 0,length-1, target);
}
public boolean check(int[] nums, int start, int end, int target)
{
if(start > end)
{
return false;
}
int mid = (start + end)/2;
if(nums[mid] == target)
{
return true;
}
return check(nums, start, mid-1,target) || check(nums, mid+1, end, target);
}
```

}