Cody

# Problem 44375. Missing five

Solution 1305276

Submitted on 20 Oct 2017 by goc3
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 = 1×1 cell array {'3'}

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

ans = 1×1 cell array {'16'}

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

ans = 1×1 cell array {'21'}

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

ans = 1×1 cell array {'99'}

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

ans = 1×1 cell array {'111'}

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

ans = 1×1 cell array {'388'}

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

ans = 1×1 cell array {'1003'}

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

ans = 1×1 cell array {'1021'}

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

ans = 1×1 cell array {'1738'}

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

ans = 1×1 cell array {'2611'}

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

ans = 1×1 cell array {'3840'}

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

ans = 1×1 cell array {'4142'}

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

ans = 1×1 cell array {'4688'}

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

ans = 1×1 cell array {'4881'}

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

ans = 1×1 cell array {'6098'}

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

ans = 1×1 cell array {'6608'}

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

ans = 1×1 cell array {'6810'}

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

ans = 1×1 cell array {'7017'}

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

ans = 1×1 cell array {'7088'}

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

ans = 1×1 cell array {'7138'}

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

ans = 1×1 cell array {'7193'}

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

ans = 1×1 cell array {'7197'}

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

ans = 1×1 cell array {'7237'}

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

ans = 1×1 cell array {'7264'}

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

ans = 1×1 cell array {'7338'}

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

ans = 1×1 cell array {'7380'}

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

ans = 1×1 cell array {'8431'}

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

ans = 1×1 cell array {'8846'}

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

ans = 1×1 cell array {'9140'}

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

ans = 1×1 cell array {'9206'}

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

ans = 1×1 cell array {'9300'}

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

ans = 1×1 cell array {'9961'}

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

ans = 1×1 cell array {'10044'}

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

ans = 1×1 cell array {'10091'}

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

ans = 1×1 cell array {'10206'}

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

ans = 1×1 cell array {'10281'}

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

ans = 1×1 cell array {'10419'}

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

ans = 1×1 cell array {'10689'}

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

ans = 1×1 cell array {'10903'}

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

ans = 1×1 cell array {'11246'}

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

ans = 1×1 cell array {'11927'}

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

ans = 1×1 cell array {'11974'}

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

ans = 1×1 cell array {'12048'}

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

ans = 1×1 cell array {'12110'}

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

ans = 1×1 cell array {'12284'}

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

ans = 1×1 cell array {'12603'}

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

ans = 1×1 cell array {'12737'}

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

ans = 1×1 cell array {'12838'}

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

ans = 1×1 cell array {'13264'}

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

ans = 1×1 cell array {'13641'}

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

ans = 1×1 cell array {'13771'}

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

ans = 1×1 cell array {'13944'}

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

ans = 1×1 cell array {'14003'}

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

ans = 1×1 cell array {'14072'}

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

ans = 1×1 cell array {'14081'}

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

ans = 1×1 cell array {'12390'} ans = 1×1 cell array {'13211'} ans = 1×1 cell array {'222'} ans = 1×1 cell array {'480'} ans = 1×1 cell array {'14707'} ans = 1×1 cell array {'13630'} ans = 1×1 cell array {'4206'} ans = 1×1 cell array {'7034'} ans = 1×1 cell array {'983'} ans = 1×1 cell array {'1348'} ans = 1×1 cell array {'13426'} ans = 1×1 cell array {'9498'} ans = 1×1 cell array {'4919'} ans = 1×1 cell array {'2881'} ans = 1×1 cell array {'6838'} ans = 1×1 cell array {'2107'} ans = 1×1 cell array {'10880'} ans = 1×1 cell array {'12093'} ans = 1×1 cell array {'2916'} ans = 1×1 cell array {'9018'} ans = 1×1 cell array {'13741'} ans = 1×1 cell array {'11999'} ans = 1×1 cell array {'10189'} ans = 1×1 cell array {'3489'} ans = 1×1 cell array {'10216'} ans = 1×1 cell array {'1779'} ans = 1×1 cell array {'9711'} ans = 1×1 cell array {'10238'} ans = 1×1 cell array {'11070'} ans = 1×1 cell array {'12267'} ans = 1×1 cell array {'12392'} ans = 1×1 cell array {'7808'} ans = 1×1 cell array {'11388'} ans = 1×1 cell array {'14149'} ans = 1×1 cell array {'14281'} ans = 1×1 cell array {'9720'} ans = 1×1 cell array {'6002'} ans = 1×1 cell array {'6016'} ans = 1×1 cell array {'7947'} ans = 1×1 cell array {'11389'} ans = 1×1 cell array {'7271'} ans = 1×1 cell array {'1364'} ans = 1×1 cell array {'10497'} ans = 1×1 cell array {'7210'} ans = 1×1 cell array {'13924'} ans = 1×1 cell array {'11126'} ans = 1×1 cell array {'13467'} ans = 1×1 cell array {'8712'} ans = 1×1 cell array {'10870'} ans = 1×1 cell array {'9729'} ans = 1×1 cell array {'2231'} ans = 1×1 cell array {'6124'} ans = 1×1 cell array {'8403'} ans = 1×1 cell array {'3246'} ans = 1×1 cell array {'9412'} ans = 1×1 cell array {'13332'} ans = 1×1 cell array {'1708'} ans = 1×1 cell array {'6294'} ans = 1×1 cell array {'14292'} ans = 1×1 cell array {'1680'} ans = 1×1 cell array {'1176'} ans = 1×1 cell array {'9302'} ans = 1×1 cell array {'9779'} ans = 1×1 cell array {'1192'} ans = 1×1 cell array {'14014'} ans = 1×1 cell array {'2142'} ans = 1×1 cell array {'13324'} ans = 1×1 cell array {'7136'} ans = 1×1 cell array {'3071'} ans = 1×1 cell array {'14116'} ans = 1×1 cell array {'13103'} ans = 1×1 cell array {'12811'} ans = 1×1 cell array {'11729'} ans = 1×1 cell array {'10398'} ans = 1×1 cell array {'8872'} ans = 1×1 cell array {'17'} ans = 1×1 cell array {'9284'} ans = 1×1 cell array {'13901'} ans = 1×1 cell array {'642'} ans = 1×1 cell array {'6748'} ans = 1×1 cell array {'11273'} ans = 1×1 cell array {'8996'} ans = 1×1 cell array {'6332'} ans = 1×1 cell array {'12607'} ans = 1×1 cell array {'12362'} ans = 1×1 cell array {'8920'} ans = 1×1 cell array {'7813'} ans = 1×1 cell array {'7498'} ans = 1×1 cell array {'4372'} ans = 1×1 cell array {'2276'} ans = 1×1 cell array {'8109'} ans = 1×1 cell array {'12898'} ans = 1×1 cell array {'1627'} ans = 1×1 cell array {'11088'} ans = 1×1 cell array {'2702'} ans = 1×1 cell array {'7161'} ans = 1×1 cell array {'8377'} ans = 1×1 cell array {'13078'} ans = 1×1 cell array {'13160'} ans = 1×1 cell array {'11297'}

57   Pass