-
4 Comments
Show
1 older comment
Steffen Zelzer
on 8 Feb 2018
This works for all but test 3 where it gives, in my opinion, the correct answer 8.
TurqoiseInt
on 13 Feb 2018
But zero is not sorted in this solution. You should get same answer for input x = 691 and 6910. (And then no need for abs())
1) 9610-0169=9441
2) 9441-1449=7992
3) 9972-2799=7173
4) 7731-1377=6354
5) 6543-3456=3087
6) 8730-0378=8352
7) 8532-2358=6174
Robert Wagner
on 7 Nov 2023
in my opinion the same result, must be 8
Robert Wagner
on 7 Nov 2023
at least a very poor problem description, it would take more time to understand it than to solve it
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!