What am i doing wrong in this code?
you are returning input to nothing .also take high as length-1
here is your corrected code:
please mark your doubt as resolved and rate as well 
you are returning input to nothing .also take high as length-1
here is your corrected code:
please mark your doubt as resolved and rate as well 