Cody

Solution 305061

Submitted on 15 Aug 2013 by James
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={'A' 'A' 'A'}; assert(howmany(x)==1)

only = AAA only = AAA AAA only = AAA AAA AAA only = AAA AAA AAA AAA only = AAA AAA AAA AAA AAA only = AAA AAA AAA AAA AAA AAA ans = 1

2   Pass
%% x={'A' 'B' 'C'}; assert(howmany(x)==0)

ans = 0

3   Pass
%% x={'A' 'A' 'A' 'A' 'B'}; assert(howmany(x)==1)

only = AABAA only = AABAA AABAA only = AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA only = AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA AABAA ans = 1

4   Pass
%% x={'A' 'A' 'A' 'B' 'B'}; assert(howmany(x)==2)

only = BAAAB only = BAAAB BAAAB only = BAAAB BAAAB BAAAB only = BAAAB BAAAB BAAAB BAAAB only = BAAAB BAAAB BAAAB BAAAB BAAAB only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB ABABA only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB ABABA ABABA only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB ABABA ABABA ABABA only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB ABABA ABABA ABABA ABABA only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB ABABA ABABA ABABA ABABA ABABA only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB ABABA ABABA ABABA ABABA ABABA ABABA only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB ABABA ABABA ABABA ABABA ABABA ABABA ABABA only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA only = BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB BAAAB ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA ABABA ans = 2

5   Pass
%% x={'A' 'A' 'A' 'B' 'B' 'B'}; assert(howmany(x)==0)

ans = 0