Problem link.

Where did I went wrong? submission here

Every help will be appreciated.

P.S. I tried doing this via two pointers approach and I already considered the testcase where answer could be more than range of int.

Please provide some testcase if possible.

Thanks in advance.