Cody

# Problem 2051. is the number happy?

Solution 387469

Submitted on 17 Jan 2014 by Neha
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
%% n = 1; y_correct = 1; assert(isequal(ishappy(n),y_correct))

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

n = 4 n = 16 n = 37 n = 58 n = 89 n = 145 n = 42 n = 20 n = 4

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

n = 10 n = 1

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

n = 10 n = 1

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

n = 2 n = 4 n = 16 n = 37 n = 58 n = 89 n = 145 n = 42 n = 20 n = 4

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

n = 2 n = 4 n = 16 n = 37 n = 58 n = 89 n = 145 n = 42 n = 20 n = 4

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

n = 1

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

n = 10 n = 1

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

n = 13 n = 10 n = 1

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

n = 82 n = 68 n = 100 n = 1

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

n = 85 n = 89 n = 145 n = 42 n = 20 n = 4 n = 16 n = 37 n = 58 n = 89

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

n = 226 n = 44 n = 32 n = 13 n = 10 n = 1