Problem with code

giving me segmentation fault

hi tejas,
I think there is some misunderstanding becuase this code is passing all the test cases.
Please let me know if there is any other doubt.