This solution is outdated. To rescore this solution, sign in.
A few primes for people...
Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
%%
assignin('caller','score',42);
x=uint16(yournumber());
assignin('caller','score',x);
problem=2825;
lines=textread('yournumber.m','%s');
id=str2num(regexp(lines{end},'\d+','match','once'));
html=urlread(sprintf('http://www.mathworks.com/matlabcentral/cody/problems/%d/solutions?term=size:%d',problem,x));
n=numel(regexpi(html,'solution \d+'));
if n~=1, n{1}=1; end %fails if the number of solutions with this score if not 1
html=urlread(sprintf('http://www.mathworks.com/matlabcentral/cody/problems/%d/solutions?term=player_id:%d+size:%d',problem,id,x));
n=numel(regexpi(html,'solution \d+'));
if n==1, n{1}=1; end %fails if the single solution with this score is your own
Error: Cell contents assignment to a non-cell array object.
|
17222 Solvers
962 Solvers
2261 Solvers
Back to basics 16 - byte order
172 Solvers
Get the length of a given vector
3569 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!