Problem 44375. Missing five
Solution Stats
Problem Comments
-
6 Comments
Too bad this problem number has a '5' in it! :-)
Ha Ha! six is the new 5!
function y = dec2missing5(x)
vec=[];
for i=1:15000
ele=num2str(i);
for j=1:length(ele)
if ele(j)=='5'
ele='';
break;
end
end
vec=[vec str2num(ele)];
end
y=vec(x);
end
why my solution is wrong???
You should return the last element of the vector
Need some trick for this problerm
Men you got so many test cases.First time I see a problerm w many test like this
Solution Comments
Show commentsProblem Recent Solvers353
Suggested Problems
-
Remove all the words that end with "ain"
2007 Solvers
-
3242 Solvers
-
7310 Solvers
-
Flag largest magnitude swings as they occur
660 Solvers
-
Number of Even Elements in Fibonacci Sequence
1138 Solvers
More from this Author38
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!