For this Question: You have an array sorted in non- decreasing order and an element key. You have to find whether the key is present inside your array or not.The first line contains a single element N(size of our array)
The next line contains N space- separated integer A[i].
The next line contains a single integer key.Determine whether the key is present in our array or not.Sample Input 1:
8
5 6 7 8 1 2 3 4
7

Sample Output 1:
1

Explanation:
7 present at 3rd index., I have written this Solution Code: #include <bits/stdc++.h>
using namespace std;
void helper(vector<int>& nums, int target,int low,int high,int &isMatch){
        if(low>high) return;
        if(low==high ){
            if(target==nums[low])
                isMatch=low;
            return;
        }
        int mid=(high-low)/2+low;
        if(isMatch==-1 && mid>=0)
             helper(nums,target,low,mid,isMatch);
        if(isMatch==-1 && mid>=0) 
            helper(nums,target,mid+1,high,isMatch);
            return;
    }
    int search(vector<int>& nums, int target) {
        int isMatch=-1;
        helper(nums,target,0,nums.size()-1,isMatch);
        return isMatch;
    }
int main()
{
	int n,key;
	cin>>n;
	vector<int>arr(n);
	for(int &i:arr)cin>>i;
	cin>>key;
	cout <<(search(arr,key)>=0 ? 1 : 0);
	return 0;
}, In this Programming Language: C++, Now tell me if this Code is compilable or not?