← All problemsSign in

Sheldon and powers

Sheldon , a student , was attending his Computer Science class . His teacher asked him to compute pow(a,b) and he was able to solve the problem for a given number of test cases . Seeing that Sheldon was able to solve the problem easily his teacher decided to make the next question a little tricky she asked Sheldon to compute pow(a,pow(b,c)) modulo 109+7 for a given number of test cases. Since

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start