Cody

# Problem 44375. Missing five

Solution 1297262

Submitted on 18 Oct 2017 by Andy Seeder
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
assert(isequal(regexprep(char(string(dec2missing5(3))),'^0*',''),'3'))

ans = '3' ans = '3'

2   Pass
assert(isequal(regexprep(char(string(dec2missing5(14))),'^0*',''),'16'))

ans = '15' ans = '16'

3   Pass
assert(isequal(regexprep(char(string(dec2missing5(19))),'^0*',''),'21'))

ans = '21' ans = '21'

4   Pass
assert(isequal(regexprep(char(string(dec2missing5(80))),'^0*',''),'99'))

ans = '88' ans = '99'

5   Pass
assert(isequal(regexprep(char(string(dec2missing5(91))),'^0*',''),'111'))

ans = '111' ans = '111'

6   Pass
assert(isequal(regexprep(char(string(dec2missing5(313))),'^0*',''),'388'))

ans = '377' ans = '388'

7   Pass
assert(isequal(regexprep(char(string(dec2missing5(732))),'^0*',''),'1003'))

ans = '1003' ans = '1003'

8   Pass
assert(isequal(regexprep(char(string(dec2missing5(748))),'^0*',''),'1021'))

ans = '1021' ans = '1021'

9   Pass
assert(isequal(regexprep(char(string(dec2missing5(1249))),'^0*',''),'1738'))

ans = '1637' ans = '1738'

10   Pass
assert(isequal(regexprep(char(string(dec2missing5(1873))),'^0*',''),'2611'))

ans = '2511' ans = '2611'

11   Pass
assert(isequal(regexprep(char(string(dec2missing5(2790))),'^0*',''),'3840'))

ans = '3740' ans = '3840'

12   Pass
assert(isequal(regexprep(char(string(dec2missing5(3035))),'^0*',''),'4142'))

ans = '4142' ans = '4142'

13   Pass
assert(isequal(regexprep(char(string(dec2missing5(3391))),'^0*',''),'4688'))

ans = '4577' ans = '4688'

14   Pass
assert(isequal(regexprep(char(string(dec2missing5(3547))),'^0*',''),'4881'))

ans = '4771' ans = '4881'

15   Pass
assert(isequal(regexprep(char(string(dec2missing5(3724))),'^0*',''),'6098'))

ans = '5087' ans = '6098'

16   Pass
assert(isequal(regexprep(char(string(dec2missing5(4057))),'^0*',''),'6608'))

ans = '5507' ans = '6608'

17   Pass
assert(isequal(regexprep(char(string(dec2missing5(4221))),'^0*',''),'6810'))

ans = '5710' ans = '6810'

18   Pass
assert(isequal(regexprep(char(string(dec2missing5(4389))),'^0*',''),'7017'))

ans = '6016' ans = '7017'

19   Pass
assert(isequal(regexprep(char(string(dec2missing5(4444))),'^0*',''),'7088'))

ans = '6077' ans = '7088'

20   Pass
assert(isequal(regexprep(char(string(dec2missing5(4489))),'^0*',''),'7138'))

ans = '6137' ans = '7138'

21   Pass
assert(isequal(regexprep(char(string(dec2missing5(4530))),'^0*',''),'7193'))

ans = '6183' ans = '7193'

22   Pass
assert(isequal(regexprep(char(string(dec2missing5(4533))),'^0*',''),'7197'))

ans = '6186' ans = '7197'

23   Pass
assert(isequal(regexprep(char(string(dec2missing5(4569))),'^0*',''),'7237'))

ans = '6236' ans = '7237'

24   Pass
assert(isequal(regexprep(char(string(dec2missing5(4585))),'^0*',''),'7264'))

ans = '6254' ans = '7264'

25   Pass
assert(isequal(regexprep(char(string(dec2missing5(4651))),'^0*',''),'7338'))

ans = '6337' ans = '7338'

26   Pass
assert(isequal(regexprep(char(string(dec2missing5(4680))),'^0*',''),'7380'))

ans = '6370' ans = '7380'

27   Pass
assert(isequal(regexprep(char(string(dec2missing5(5455))),'^0*',''),'8431'))

ans = '7431' ans = '8431'

28   Pass
assert(isequal(regexprep(char(string(dec2missing5(5711))),'^0*',''),'8846'))

ans = '7745' ans = '8846'

29   Pass
assert(isequal(regexprep(char(string(dec2missing5(5949))),'^0*',''),'9140'))

ans = '8140' ans = '9140'

30   Pass
assert(isequal(regexprep(char(string(dec2missing5(5999))),'^0*',''),'9206'))

ans = '8205' ans = '9206'

31   Pass
assert(isequal(regexprep(char(string(dec2missing5(6075))),'^0*',''),'9300'))

ans = '8300' ans = '9300'

32   Pass
assert(isequal(regexprep(char(string(dec2missing5(6526))),'^0*',''),'9961'))

ans = '8851' ans = '9961'

33   Pass
assert(isequal(regexprep(char(string(dec2missing5(6601))),'^0*',''),'10044'))

ans = '10044' ans = '10044'

34   Pass
assert(isequal(regexprep(char(string(dec2missing5(6634))),'^0*',''),'10091'))

ans = '10081' ans = '10091'

35   Pass
assert(isequal(regexprep(char(string(dec2missing5(6728))),'^0*',''),'10206'))

ans = '10205' ans = '10206'

36   Pass
assert(isequal(regexprep(char(string(dec2missing5(6787))),'^0*',''),'10281'))

ans = '10271' ans = '10281'

37   Pass
assert(isequal(regexprep(char(string(dec2missing5(6902))),'^0*',''),'10419'))

ans = '10418' ans = '10419'

38   Pass
assert(isequal(regexprep(char(string(dec2missing5(7037))),'^0*',''),'10689'))

ans = '10578' ans = '10689'

39   Pass
assert(isequal(regexprep(char(string(dec2missing5(7212))),'^0*',''),'10903'))

ans = '10803' ans = '10903'

40   Pass
assert(isequal(regexprep(char(string(dec2missing5(7493))),'^0*',''),'11246'))

ans = '11245' ans = '11246'

41   Pass
assert(isequal(regexprep(char(string(dec2missing5(7962))),'^0*',''),'11927'))

ans = '11826' ans = '11927'

42   Pass
assert(isequal(regexprep(char(string(dec2missing5(7996))),'^0*',''),'11974'))

ans = '11864' ans = '11974'

43   Pass
assert(isequal(regexprep(char(string(dec2missing5(8062))),'^0*',''),'12048'))

ans = '12047' ans = '12048'

44   Pass
assert(isequal(regexprep(char(string(dec2missing5(8109))),'^0*',''),'12110'))

ans = '12110' ans = '12110'

45   Pass
assert(isequal(regexprep(char(string(dec2missing5(8248))),'^0*',''),'12284'))

ans = '12274' ans = '12284'

46   Pass
assert(isequal(regexprep(char(string(dec2missing5(8427))),'^0*',''),'12603'))

ans = '12503' ans = '12603'

47   Pass
assert(isequal(regexprep(char(string(dec2missing5(8538))),'^0*',''),'12737'))

ans = '12636' ans = '12737'

48   Pass
assert(isequal(regexprep(char(string(dec2missing5(8620))),'^0*',''),'12838'))

ans = '12737' ans = '12838'

49   Pass
assert(isequal(regexprep(char(string(dec2missing5(8959))),'^0*',''),'13264'))

ans = '13254' ans = '13264'

50   Pass
assert(isequal(regexprep(char(string(dec2missing5(9190))),'^0*',''),'13641'))

ans = '13541' ans = '13641'

51   Pass
assert(isequal(regexprep(char(string(dec2missing5(9289))),'^0*',''),'13771'))

ans = '13661' ans = '13771'

52   Pass
assert(isequal(regexprep(char(string(dec2missing5(9436))),'^0*',''),'13944'))

ans = '13844' ans = '13944'

53   Pass
assert(isequal(regexprep(char(string(dec2missing5(9480))),'^0*',''),'14003'))

ans = '14003' ans = '14003'

54   Pass
assert(isequal(regexprep(char(string(dec2missing5(9533))),'^0*',''),'14072'))

ans = '14062' ans = '14072'

55   Pass
assert(isequal(regexprep(char(string(dec2missing5(9541))),'^0*',''),'14081'))

ans = '14071' ans = '14081'

56   Pass
for n=1:100, assert(all(char(string(dec2missing5(randi(10000))))~='5')); end

ans = '3272' ans = '3282' ans = '10521' ans = '10621' ans = '12676' ans = '12787' ans = '11205' ans = '11206' ans = '27' ans = '28' ans = '7746' ans = '8847' ans = '6812' ans = '7912' ans = '1771' ans = '1881' ans = '8215' ans = '9216' ans = '11645' ans = '11746' ans = '6034' ans = '7034' ans = '6784' ans = '7894' ans = '6652' ans = '7762' ans = '11421' ans = '11421' ans = '12440' ans = '12440' ans = '8783' ans = '9893' ans = '11472' ans = '11482' ans = '13748' ans = '13849' ans = '7518' ans = '8619' ans = '11275' ans = '11286' ans = '156' ans = '167' ans = '4713' ans = '4813' ans = '12251' ans = '12261' ans = '5686' ans = '6797' ans = '8466' ans = '9477' ans = '863' ans = '973' ans = '5883' ans = '6993' ans = '11444' ans = '11444' ans = '11732' ans = '11832' ans = '6585' ans = '7696' ans = '1005' ans = '1006' ans = '4816' ans = '4917' ans = '5453' ans = '6463' ans = '6472' ans = '7482' ans = '2353' ans = '2363' ans = '7747' ans = '8848' ans = '8647' ans = '9748' ans = '2331' ans = '2331' ans = '11414' ans = '11414' ans = '4520' ans = '4620' ans = '6760' ans = '7870' ans = '3343' ans = '3343' ans = '8315' ans = '9316' ans = '3013' ans = '3013' ans = '8336' ans = '9337' ans = '1112' ans = '1112' ans = '2886' ans = '2997' ans = '2156' ans = '2167' ans = '8653' ans = '9763' ans = '3858' ans = '3969' ans = '6688' ans = '7799' ans = '12760' ans = '12870' ans = '5708' ans = '6809' ans = '2130' ans = '2130' ans = '1681' ans = '1791' ans = '12877' ans = '12988' ans = '5328' ans = '6329' ans = '7530' ans = '8630' ans = '8201' ans = '9201' ans = '8028' ans = '9029' ans = '12115' ans = '12116' ans = '6321' ans = '7321' ans = '13118' ans = '13119' ans = '6887' ans = '7998' ans = '3083' ans = '3093' ans = '14323' ans = '14323' ans = '3284' ans = '3294' ans = '7537' ans = '8638' ans = '14358' ans = '14369' ans = '651' ans = '761' ans = '14611' ans = '14711' ans = '4' ans = '4' ans = '2557' ans = '2668' ans = '13744' ans = '13844' ans = '4560' ans = '4670' ans = '2824' ans = '2924' ans = '11884' ans = '11994' ans = '14160' ans = '14170' ans = '14118' ans = '14119' ans = '10556' ans = '10667' ans = '11472' ans = '11482' ans = '2316' ans = '2317' ans = '4814' ans = '4914' ans = '13518' ans = '13619' ans = '7147' ans = '8148' ans = '668' ans = '779' ans = '5055' ans = '6066' ans = '10377' ans = '10388' ans = '7178' ans = '8189' ans = '5115' ans = '6116' ans = '2725' ans = '2826' ans = '14276' ans = '14287' ans = '7361' ans = '8371' ans = '12562' ans = '12672' ans = '12531' ans = '12631' ans = '1008' ans = '1009' ans = '201' ans = '201' ans = '4418' ans = '4419' ans = '6322' ans = '7322' ans = '316' ans = '317'