In my pc it's working

#include
using namespace std;
int hel(int arr[],int n,int key)
{
int s=0,e=n-1,mid,ans=-1;
while(s<=e)
{
mid=(s+e)/2;
if(arr[mid]==key)
{
ans=mid;
return ans;
}
else if(arr[s]<=arr[mid])
{
if(key>=arr[s] && key<=arr[mid])
{
e=mid-1;
}
else
{
s=mid+1;
}
}
else
{
if(key>=arr[mid] && key<=arr[e])
{
s=mid+1;
}
else
{
e=mid-1;
}
}
}
}
int main()
{
int N,Key;
cin>>N;
int arr[N]={0};
for(int i=0;i<N;i++)
{
cin>>arr[i];
}
cin>>Key;
cout<<hel(arr,N,Key);
return 0;
}

your submissions show that you have scored 100! great job :slight_smile: if this solves your doubt please mark it as resolved