Cody

# Problem 2907. Collaborative Fun : Nomination

Solution 758883

Submitted on 12 Oct 2015 by Peng Liu
• Size: -100
• This is the leading solution.
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
lines=textread('nomination.m','%s'); id_own=str2num(regexp(lines{end},'\d+','match','once')); x=uint64(nomination()); if x == uint64(id_own) assignin('caller','score',-1); error('Funny! You tried to nominate yourself!') end assignin('caller','score',x); problem=2907; html=urlread(sprintf('http://www.mathworks.com/matlabcentral/cody/problems/%d/solutions?term=size:%d',problem,id_own)); n=numel(regexpi(html,'solution \d+')); if n < 1 error('Sorry. You are nominated by none.'); end %_______ url = sprintf('https://www.mathworks.com/matlabcentral/cody/players/%d',x); html = urlread(url); c = regexp(html,'h1.+h1','match'); name = c{1}(4:end-4); s = sprintf('____________________\n\nYou have nominated %s !!!',name); disp(s)

[Warning: Function error has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function error has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [Warning: Function toc has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] ____________________ You have nominated Josh Natanson !!! testSuiteResults = score: '-100' testSuiteResults = score: '-100' testSuiteResults = score: '-100'