Not sure if the only test case passed is by luck or something

i think i had done some blunder in this code, please tell if this approach is correct or not
and tell me where it can be wrong

hi @sy7176442_ca8a8991a7ddc322,
the blunder is u r using int hehe :joy:
the code is good just use long long everywhere

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.