Well done, sir (and on your first try! You are clearly paying attention to the details :)
Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
%%
Ntest=1e4;
N=randi([10,100],Ntest,1);
K=randi([1 10],Ntest,1);
M=arrayfun(@(N,K)max(randi(N,1,K)),N,K);
N_hat=arrayfun(@tank_problem,K,M);
rate=mean(N==N_hat);
assert(rate>=.1,sprintf('hit rate too low (%0.2f%%)',rate*100));
fprintf('hit rate = %0.2f%%\n',rate*100);
hit rate = 12.70%
|
Extract leading non-zero digit
967 Solvers
Convert a vector into a number
442 Solvers
185 Solvers
Volume of a sphere given its surface area
89 Solvers
Fahrenheit to Celsius converter
262 Solvers