File tree Expand file tree Collapse file tree 1 file changed +0
-21
lines changed
src/main/java/com/fishercoder/solutions Expand file tree Collapse file tree 1 file changed +0
-21
lines changed Original file line number Diff line number Diff line change 1
1
package com .fishercoder .solutions ;
2
2
3
- /**
4
- * 1134. Armstrong Number
5
- *
6
- * The k-digit number N is an Armstrong number if and only if the k-th power of each digit sums to N.
7
- * Given a positive integer N, return true if and only if it is an Armstrong number.
8
- *
9
- * Example 1:
10
- * Input: 153
11
- * Output: true
12
- * Explanation:
13
- * 153 is a 3-digit number, and 153 = 1^3 + 5^3 + 3^3.
14
- *
15
- * Example 2:
16
- * Input: 123
17
- * Output: false
18
- * Explanation:
19
- * 123 is a 3-digit number, and 123 != 1^3 + 2^3 + 3^3 = 36.
20
- *
21
- * Note:
22
- * 1 <= N <= 10^8
23
- * */
24
3
public class _1134 {
25
4
public static class Solution1 {
26
5
public boolean isArmstrong (int N ) {
You can’t perform that action at this time.
0 commit comments