Arrays - binary search

Test case #2 is not passed pls help ere is my code ::: https://ide.codingblocks.com/s/61006

@hey ankush you did small misktake at line 9 you are check if(mid>key)mid-1;
but you have check value on that index instead you’re are comparing key with index which will not work.I have corrected your code you can refer this

Hi Ankush,
as you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.