Tap here to switch tabs
Problem
Submissions

Problem: Armstrong Number

Armstrong Number asks you to return whether a positive integer equals the sum of its digits, with every digit raised to the power of the number of digits.

Statement

Given an integer n, return true if it is an Armstrong number, or false otherwise.

An integer n is an Armstrong number if the sum of each of its digits raised to the power of kk is equal to n, where kk is the total number of digits in n.

Constraints:

  • 1≤1 \leq n ≤108\leq 10^8

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Armstrong Number

Armstrong Number asks you to return whether a positive integer equals the sum of its digits, with every digit raised to the power of the number of digits.

Statement

Given an integer n, return true if it is an Armstrong number, or false otherwise.

An integer n is an Armstrong number if the sum of each of its digits raised to the power of kk is equal to n, where kk is the total number of digits in n.

Constraints:

  • 1≤1 \leq n ≤108\leq 10^8