Cody

# Problem 574. Sort numbers by outside digits

Solution 1201195

Submitted on 30 May 2017 by Augusto Mazzei
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
x = [12368933, 12345931, 68221, 533111, 3819999999999]; y_correct = [12345931, 12368933, 3819999999999, 533111, 68221]; assert(isequal(your_fcn_name(x),y_correct))

a = '12368933' c = 12333 a = '12345931' c = 12333 12331 a = '68221' c = 12333 12331 68221 a = '533111' c = 12333 12331 68221 53311 a = '3819999999999' c = 12333 12331 68221 53311 38199 y = 1.0e+12 * 0.0000 0.0000 3.8200 0.0000 0.0000

2   Pass
x = [4591023, 37410101, 97516, 888123, 15061789]; y_correct = [15061789, 37410101, 4591023, 888123, 97516]; assert(isequal(your_fcn_name(x),y_correct))

a = '4591023' c = 45923 a = '37410101' c = 45923 37401 a = '97516' c = 45923 37401 97516 a = '888123' c = 45923 37401 97516 88823 a = '15061789' c = 45923 37401 97516 88823 15089 y = 15061789 37410101 4591023 888123 97516

3   Pass
x = [1110098, 1110197, 1110296, 1110395, 1110494, 1110593, 1110691]; y_correct = fliplr(x); assert(isequal(your_fcn_name(x),y_correct))

a = '1110098' c = 11198 a = '1110197' c = 11198 11197 a = '1110296' c = 11198 11197 11196 a = '1110395' c = 11198 11197 11196 11195 a = '1110494' c = 11198 11197 11196 11195 11194 a = '1110593' c = 11198 11197 11196 11195 11194 11193 a = '1110691' c = 11198 11197 11196 11195 11194 11193 11191 y = 1110691 1110593 1110494 1110395 1110296 1110197 1110098

4   Pass
x = [324651, 65432114, 1032464, 21465476, 1232165746561, 12321]; y_correct = [1032464, 12321, 1232165746561, 21465476, 324651, 65432114]; assert(isequal(your_fcn_name(x),y_correct))

a = '324651' c = 32451 a = '65432114' c = 32451 65414 a = '1032464' c = 32451 65414 10364 a = '21465476' c = 32451 65414 10364 21476 a = '1232165746561' c = 32451 65414 10364 21476 12361 a = '12321' c = 32451 65414 10364 21476 12361 12321 y = 1.0e+12 * 0.0000 0.0000 1.2322 0.0000 0.0000 0.0001