LLOGNDURFYPN7HOQZMXW7FCQAQVL66QWE5BWOPCDZJFF7EOQO3OAC
// Package armstrong handler Armstrong numbers.
package armstrong
import (
"math"
)
// IsNumber returns true if input is an Armstrong number.
func IsNumber(input int) bool {
digits := []int{}
func(in int) {
for in != 0 {
// order reversed, does not matter this case
digits = append(digits, in%10)
in /= 10
}
}(input)
var sum int
for _, d := range digits {
sum += int(math.Pow(float64(d), float64(len(digits))))
}
if sum == input {
return true
}
return false
}