Cody

# Problem 2051. is the number happy?

Solution 1520259

Submitted on 7 May 2018
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   Fail
n = 1; y_correct = 1; assert(isequal(ishappy(n),y_correct))

Undefined function 'ishappy' for input arguments of type 'double'. Error in Test1 (line 3) assert(isequal(ishappy(n),y_correct))

2   Fail
n = 2; y_correct = 0; assert(isequal(ishappy(n),y_correct))

Undefined function 'ishappy' for input arguments of type 'double'. Error in Test2 (line 3) assert(isequal(ishappy(n),y_correct))

3   Fail
n = 31; y_correct = 1; assert(isequal(ishappy(n),y_correct))

Undefined function 'ishappy' for input arguments of type 'double'. Error in Test3 (line 3) assert(isequal(ishappy(n),y_correct))

4   Fail
n = 13; y_correct = 1; assert(isequal(ishappy(n),y_correct))

Undefined function 'ishappy' for input arguments of type 'double'. Error in Test4 (line 3) assert(isequal(ishappy(n),y_correct))

5   Fail
n = 11; y_correct = 0; assert(isequal(ishappy(n),y_correct))

Undefined function 'ishappy' for input arguments of type 'double'. Error in Test5 (line 3) assert(isequal(ishappy(n),y_correct))

6   Fail
n = 101; y_correct = 0; assert(isequal(ishappy(n),y_correct))

Undefined function 'ishappy' for input arguments of type 'double'. Error in Test6 (line 3) assert(isequal(ishappy(n),y_correct))

7   Fail
n = 100; y_correct = 1; assert(isequal(ishappy(n),y_correct))

Undefined function 'ishappy' for input arguments of type 'double'. Error in Test7 (line 3) assert(isequal(ishappy(n),y_correct))

8   Fail
n = 130; y_correct = 1; assert(isequal(ishappy(n),y_correct))

Undefined function 'ishappy' for input arguments of type 'double'. Error in Test8 (line 3) assert(isequal(ishappy(n),y_correct))

9   Fail
n = 230; y_correct = 1; assert(isequal(ishappy(n),y_correct))

Undefined function 'ishappy' for input arguments of type 'double'. Error in Test9 (line 3) assert(isequal(ishappy(n),y_correct))

10   Fail
n = 190; y_correct = 1; assert(isequal(ishappy(n),y_correct))

Undefined function 'ishappy' for input arguments of type 'double'. Error in Test10 (line 3) assert(isequal(ishappy(n),y_correct))

11   Fail
n = 290; y_correct = 0; assert(isequal(ishappy(n),y_correct))

Undefined function 'ishappy' for input arguments of type 'double'. Error in Test11 (line 3) assert(isequal(ishappy(n),y_correct))

12   Fail
n = 998; y_correct = 1; assert(isequal(ishappy(n),y_correct))

Undefined function 'ishappy' for input arguments of type 'double'. Error in Test12 (line 3) assert(isequal(ishappy(n),y_correct))