Cody

Solution 1325848

Submitted on 3 Nov 2017 by David Verrelli
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'

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

ans = '16'

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

ans = '21'

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

ans = '99'

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

ans = '111'

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

ans = '388'

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

ans = '1003'

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

ans = '1021'

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

ans = '1738'

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

ans = '2611'

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

ans = '3840'

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

ans = '4142'

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

ans = '4688'

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

ans = '4881'

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

ans = '6098'

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

ans = '6608'

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

ans = '6810'

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

ans = '7017'

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

ans = '7088'

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

ans = '7138'

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

ans = '7193'

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

ans = '7197'

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

ans = '7237'

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

ans = '7264'

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

ans = '7338'

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

ans = '7380'

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

ans = '8431'

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

ans = '8846'

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

ans = '9140'

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

ans = '9206'

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

ans = '9300'

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

ans = '9961'

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

ans = '10044'

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

ans = '10091'

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

ans = '10206'

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

ans = '10281'

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

ans = '10419'

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

ans = '10689'

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

ans = '10903'

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

ans = '11246'

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

ans = '11927'

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

ans = '11974'

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

ans = '12048'

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

ans = '12110'

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

ans = '12284'

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

ans = '12603'

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

ans = '12737'

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

ans = '12838'

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

ans = '13264'

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

ans = '13641'

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

ans = '13771'

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

ans = '13944'

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

ans = '14003'

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

ans = '14072'

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

ans = '14081'

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

ans = '12921' ans = '842' ans = '9903' ans = '6717' ans = '2397' ans = '11202' ans = '8829' ans = '7419' ans = '9789' ans = '6773' ans = '11448' ans = '9089' ans = '4331' ans = '2780' ans = '2082' ans = '6032' ans = '14610' ans = '3969' ans = '13739' ans = '13006' ans = '9330' ans = '12249' ans = '6084' ans = '6984' ans = '10138' ans = '904' ans = '13241' ans = '12987' ans = '13493' ans = '3663' ans = '11488' ans = '27' ans = '8246' ans = '13044' ans = '11930' ans = '8363' ans = '7480' ans = '4499' ans = '7370' ans = '9231' ans = '12690' ans = '4893' ans = '11942' ans = '6874' ans = '14212' ans = '10024' ans = '12261' ans = '907' ans = '9316' ans = '4703' ans = '8290' ans = '4948' ans = '2906' ans = '720' ans = '12308' ans = '10309' ans = '7907' ans = '6281' ans = '1308' ans = '842' ans = '7401' ans = '9364' ans = '10488' ans = '6729' ans = '4784' ans = '3776' ans = '3133' ans = '10079' ans = '12432' ans = '14194' ans = '14021' ans = '1829' ans = '13866' ans = '366' ans = '2169' ans = '12011' ans = '9176' ans = '13032' ans = '14142' ans = '9802' ans = '3922' ans = '13897' ans = '1747' ans = '13401' ans = '7710' ans = '8048' ans = '603' ans = '1627' ans = '13786' ans = '13328' ans = '6431' ans = '10818' ans = '678' ans = '9703' ans = '13298' ans = '4262' ans = '12140' ans = '12814' ans = '2407' ans = '1011'

57   Pass
x='1000'; for n=1:7, x=char(string(dec2missing5(str2double(x)))); end; assert(isequal(regexprep(x,'^0*',''),'11027'));

ans = '1331' ans = '1839' ans = '2473' ans = '3348' ans = '4630' ans = '7314' ans = '11027'

58   Pass
x='234'; for n=1:10, x=char(string(dec2missing5(str2double(x)))); end; assert(isequal(regexprep(x,'^0*',''),'4240'));

ans = '290' ans = '362' ans = '442' ans = '641' ans = '892' ans = '1201' ans = '1684' ans = '2281' ans = '3114' ans = '4240'

59   Pass
assert(~any(cellfun(@(x)ismember(max([0,str2num(x)]),[13944,14003,14072,14081]),regexp(fileread('dec2missing5.m'),'((\s*[\+\-\*\/]\s*)?[\d\.])+','match'))),'please do not use look-up table solutions');