Whats wrong with the following submission ID : 5765626 :
//code removed
when n=1, depending on k there is chance modExp(0 ,k,n) returns 1
That is one corner case. Even after fixing that even my code gives WA .... Let me knows if you find anything interesting
I tried playing with n=1 but to no avail. I dont find anything wrong with the code. Wonder whats missing!