Cody

# Problem 2687. Find the mode of the given input

Solution 1891339

Submitted on 3 Aug 2019
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
x = [ 3 3 1 4; 0 0 1 1; 0 1 2 4]; y_correct = 1; assert(isequal(mode_cody(x),y_correct))

ans = 0 0 1 4

Assertion failed.

2   Fail
x = [ 3 0 1 4; 0 0 1 0; 0 0 2 4]; y_correct = 0; assert(isequal(mode_cody(x),y_correct))

ans = 0 0 1 4

Assertion failed.

3   Fail
x =eye(5); y_correct = 0; assert(isequal(mode_cody(x),y_correct))

ans = 0 0 0 0 0

Assertion failed.

4   Fail
x =eye(5)+2; y_correct = 2; assert(isequal(mode_cody(x),y_correct))

ans = 2 2 2 2 2

Assertion failed.

5   Fail
x =ones(5)+1.2; y_correct = 2.2; assert(isequal(mode_cody(x),y_correct))

ans = 2.2000 2.2000 2.2000 2.2000 2.2000

Assertion failed.

6   Fail
x =zeros(5)+1.2; y_correct = 1.2; assert(isequal(mode_cody(x),y_correct))

ans = 1.2000 1.2000 1.2000 1.2000 1.2000

Assertion failed.