Cody

Solution 535357

Submitted on 25 Nov 2014
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
%% tic N=5;K=2; NK=nchoosekJava(N,K); toc assert(strcmp(NK,num2str(nchoosek(N,K))))

4x1 struct array with fields: file name line Elapsed time is 0.005130 seconds.

2   Pass
%% tic N=randi(10); K=randi(N); NK=nchoosekJava(N,K); toc assert(strcmp(NK,num2str(nchoosek(N,K))))

4x1 struct array with fields: file name line Elapsed time is 0.001649 seconds.

3   Pass
%% tic N=100; K=50; NK=nchoosekJava(N,K); toc assert(strcmp(NK,'100891344545564193334812497256'))

4x1 struct array with fields: file name line Elapsed time is 0.009893 seconds.

4   Fail
%% tic N=200; K=75; NK=nchoosekJava(N,K); toc assert(strcmp(NK,'168849997346404286704489530268603459022868706883102845056'))

Error: Assertion failed.