Doubt in array binary search


it giving wrong answer for 2 testcases , please help me find out why??

hey @shubham.mehla2000, you should return -1 in case element not fount. Just add return -1 after the while loop.

1 Like

hey @shubham.mehla2000 , if your query is resolved. Please mark this doubt as resolved and rate me on the basis of your experience.
rating option will appear when to mark this doubt as resolved

1 Like