Few test cases failing

you are reusing the variable n
corrected code

Ohh yes!! :slight_smile:


But we can do like this too?one test case is still failing.please see to it sir.

use long long instead of int.