DIGIT LAST (code mate round 1)

Given a number n. Find the last two digits of 5 ^ n ( 5 to the power of n ). Remember that overflow can occur.
2<=N<=2.1018
Can anyone explain why the answer will always be 25 for this question.
Link to the question

1 Like

for n>=2
last two digits of 5^n will always be 25.
for n==1
its 5

Can value of N be 2.1018 ? then ans will be 29.45

2 Likes

N is always an integer

Continuing the discussion from DIGIT LAST (code mate round 1):

Here it is given 2<=N<=2.1018
So it cannot be said that N is an integer only.

what I believe is that range is not 2<=N<=2.1018 but 2<=N<=2*10^18 … a typing error in constraints

2 Likes