Armstrong Number

给一个数字n, 求n是不是 Armstrong Number. Armstrong Number 就是每个数位上的数pow数字长度后的和等于数字本身.

class Solution {
    public boolean isArmstrong(int N) {
        int len = String.valueOf(N).length();
        int t = 0;
        int n = N;
        while(N > 0) {
            t += Math.pow(N % 10, len);
            N /= 10;
        }
        return t == n;
    }
}