class Solution {
public:
int guessNumber(int n) {
long long int mid,low,high,res;
high=n;
low=1;
//// int ans=-1;
while(low<=high)
{
mid= (low+high)/2;
////res=guess(mid);
if(guess(mid)==0)// if uer grt both guess(mid) or num and pick at same index simply return that index
return mid;//base case final result after all modifications is gt here
// and simply return the req mid indx value
else if(guess(mid)==-1)// if num or guess(mid)>pick // pick is cinst here
// the above case simply say that num > pick value so to reach picked index values simply decreament the nxt idx with one
high=mid-1;
else
low=mid+1;// same as above case simply increament the prev indx with one
}
////return mid;
return -1;// if n is out of range of picked then simply return false like invalid arguement
// whcih returns -1//
}};