Cody

# Problem 367. Specific Element Count

Solution 2041786

Submitted on 2 Dec 2019 by Vít Lochman
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
assert(isequal(ecount(1:10,2),1))

d = logical 0 e = 2 ct = 0 ct = 1 ct = 1 ct = 1 ct = 1 ct = 1 ct = 1 ct = 1 ct = 1 ct = 1

2   Pass
assert(isequal(ecount([1 1 1 1 1 1 1 1],1),8))

d = logical 0 e = 1 ct = 1 ct = 2 ct = 3 ct = 4 ct = 5 ct = 6 ct = 7 ct = 8

3   Pass
assert(isequal(ecount([1 1 1 1 1 1 1 1],2),0))

d = logical 0 e = 2 ct = 0 ct = 0 ct = 0 ct = 0 ct = 0 ct = 0 ct = 0 ct = 0

4   Pass
assert(isequal(ecount([1 1 1 1 NaN NaN 1 1],NaN),2))

d = logical 1 e = 0 ct = 0 ct = 0 ct = 0 ct = 0 ct = 1 ct = 2 ct = 2 ct = 2

5   Pass
assert(isequal(ecount([1 1 1 1 NaN NaN 1 1],17),0))

d = logical 0 e = 17 ct = 0 ct = 0 ct = 0 ct = 0 ct = 0 ct = 0 ct = 0 ct = 0

6   Pass
assert(isequal(ecount([15 13 6 2 71 -5 -7 15],15),2))

d = logical 0 e = 15 ct = 1 ct = 1 ct = 1 ct = 1 ct = 1 ct = 1 ct = 1 ct = 2