Armstrong Number
A K-digit number is an Armstrong number if the sum of its digits, each raised to the K-th power, equals the number itself (153 = 1³+5³+3³). Check N.
Input: one integer N.
Output: YES or NO.
Constraints:
- 1 ≤ N ≤ 1018
Sample Tests
Input 1
153
Output 1
YES
Input 2
154
Output 2
NO
Discussion (opens after you solve — no spoilers before)
No comments yet.