Self-Powered Number
A narcissistic number can be rebuilt from its own digits using a special rule. Write narcissistic, which checks the number value: raise each digit to the power equal to the number of digits, then add the results. Return True if that sum equals the original number; otherwise return False.
Примеры
Ввод
153Вывод
TrueВвод
1652Вывод
FalseВвод
7Вывод
TrueНужно реализовать
def narcissistic(value: int) -> bool:
Теги
math
Conectează-te pentru a vedea istoricul soluțiilor trimise
Conectează-teConectează-te pentru a folosi Mentorul AI
Conectează-teVisible tests
1
Input
153Expected
True2
Input
1652Expected
False3
Input
7Expected
True4
Input
371Expected
True5
Input
9474Expected
True6
Input
9475Expected
FalseFocus radio
Paused · SomaFM · Fluid