One testcase is not pass why?

hi @arjundkl, you are returning when i==m-1 instead of i==m due to which you are not checking for the last element
here i have corrected your code: https://ide.codingblocks.com/s/216543

in case of any further doubt feel free to ask :slight_smile:
mark your doubt as resolved if you got the answer