Cody

# Problem 1889. Get ranking of a combination looking for speed.

Solution 1712986

Submitted on 22 Jan 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   Pass
feval(@assignin,'caller','score',0);

2   Fail
vec1 = [1 6 13]; vec2 = [1 2 4]; vec3 = [3 5 8]; vec4 = [5 9 11]; answer1 = 45; answer2 = 2; answer3 = 133; answer4 = 222; for i=1:5 % Warmup Calls to get valid timing value = get3HCRank(vec1); end ta=clock; for i = 1:10000 ansU1=get3HCRank(vec1); ansU2=get3HCRank(vec2); ansU3=get3HCRank(vec3); ansU4=get3HCRank(vec4); end t1=etime(clock,ta); timing = t1 * 95; benchmark = 100; assert(isequal(ansU1,answer1)) assert(isequal(ansU2,answer2)) assert(isequal(ansU3,answer3)) assert(isequal(ansU4,answer4)) assert(timing < benchmark) out = timing feval(@assignin,'caller','score',out);

Undefined function or variable 'ans'. Error in get3HCRank (line 6) find(ismember(ans,v,'rows')); Error in Test2 (line 11) value = get3HCRank(vec1);

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!