Why am i getting runtime error for large input?

I have edited your code, kindly refer to it ,