← All problemsSign in

Super Power

You are building a system to find super power of a given number. Given two integers, N and P, super power is the sum of the P-th powers of every digit in N. For eg: if N =1453 and P =2 then super power = $1^2 + 4^2 + 5^2 + 3^2 = 51$. If either N or P is negative, then you should output "Super Power is only of Positive Numbers". Also, if both P and N are zero, then you should output "Zero cant

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