I have already tried modPow()
function for BigInteger
in java.
But it needed too long.
I know the modular multiplication, even exponentiation too.
But I am unable solve this problem because of constraints.
a
, b
have values which can have 1000000
digits in it (so huge, is it not)?
Now I want to find (a**b)%c
.
As a first step,we can do a = a % c
.
But here, even b
is so huge.
c = 10^9+7