Test | Status | Code Input and Output |
---|---|---|
1 | Fail |
% Create necessary files
fid = fopen('myfunction.m', 'w');fprintf(fid, 'function [a, b]=myfunction(), a=now; b=@()1;');fclose(fid);
rehash;
% Execute my function 10 times
y=cell(10,1);
for iter=1:10
[x y{iter}]=myfunction();
end
% Ouch! I have overwritten the value of "x"
% Your task is to recover the value of the 3rd "x"
x3=your_solution();
% Clean the working directory (just in case)
!/bin/rm checksolution.*
% Build the solution checker checksolution.p
!/bin/echo "7630302e30307630302e30300005001cafeb3fb50000002c000000b7000000d0ef156cd482f6727568c9cb0434da4ffad9a709bcec12d21f8ccf6a6c736d54e232a2d8ed0f6c4af6e41cc8816d0521bc25f8f51890e51c1b4b151fd6b9731f0a501974f4c3b7fc8831644a60d74f49599303f43d51c9ce82b407b10a500ddd2e02933868a8815ce645d02a48c2c7fb5de99f2bc5fa313693cfc79482545e1aba66aa34776b8e2a46a370f472bfb3e2332bbf0ccc4043646014651579160c1ef8694310327422bee0059f02d33326f7b77b41cf2f273e4e" | /usr/bin/xxd -ps -r > checksolution.p
rehash;
% Check how you have done
if checksolution(x3) else fail{'☠'}, end
/bin/rm: cannot remove ‘checksolution.*’: No such file or directory
|
Find the longest sequence of 1's in a binary sequence.
2446 Solvers
Sort a list of complex numbers based on far they are from the origin.
3795 Solvers
722 Solvers
Test if a Number is a Palindrome without using any String Operations
157 Solvers
28 Solvers