Segmentation fault. please help..

I am getting segmentation fault for this problem.
link text

it accepts 9 test cases, but not the 10th one

here’s my solution
link text

It means that you were trying to access an invalid memory reference. In your code, value of “i” is increased beyond the size of “arr” array." Check my submission which got SIGABRT.

Thanks. Solved it