Cody

Problem 1407. Is it an Armstrong number?

Solution 1827972

Submitted on 27 May 2019 by Anshil Kumar
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = 153; y_correct = 1; assert(isequal(armno(x),y_correct))

n = '153' n = '153' l = [] l = 1 l = 1 125 l = 1 125 27 y = logical 1

2   Pass
x = 143; y_correct = 0; assert(isequal(armno(x),y_correct))

n = '143' n = '143' l = [] l = 1 l = 1 64 l = 1 64 27 y = logical 0

3   Pass
x = 370; y_correct = 1; assert(isequal(armno(x),y_correct))

n = '370' n = '370' l = [] l = 27 l = 27 343 l = 27 343 0 y = logical 1

4   Pass
x = 371; y_correct = 1; assert(isequal(armno(x),y_correct))

n = '371' n = '371' l = [] l = 27 l = 27 343 l = 27 343 1 y = logical 1

5   Pass
x = 145; y_correct = 0; assert(isequal(armno(x),y_correct))

n = '145' n = '145' l = [] l = 1 l = 1 64 l = 1 64 125 y = logical 0

6   Pass
x = 407; y_correct = 1; assert(isequal(armno(x),y_correct))

n = '407' n = '407' l = [] l = 64 l = 64 0 l = 64 0 343 y = logical 1

7   Pass
x = 136; y_correct = 0; assert(isequal(armno(x),y_correct))

n = '136' n = '136' l = [] l = 1 l = 1 27 l = 1 27 216 y = logical 0