Cody

# Problem 44375. Missing five

Solution 1939110

Submitted on 17 Sep 2019
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   Fail
assert(isequal(regexprep(char(string(dec2missing5(3))),'^0*',''),'3'))

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test1 (line 1) assert(isequal(regexprep(char(string(dec2missing5(3))),'^0*',''),'3'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test2 (line 1) assert(isequal(regexprep(char(string(dec2missing5(14))),'^0*',''),'16'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test3 (line 1) assert(isequal(regexprep(char(string(dec2missing5(19))),'^0*',''),'21'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test4 (line 1) assert(isequal(regexprep(char(string(dec2missing5(80))),'^0*',''),'99'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test5 (line 1) assert(isequal(regexprep(char(string(dec2missing5(91))),'^0*',''),'111'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test6 (line 1) assert(isequal(regexprep(char(string(dec2missing5(313))),'^0*',''),'388'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test7 (line 1) assert(isequal(regexprep(char(string(dec2missing5(732))),'^0*',''),'1003'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test8 (line 1) assert(isequal(regexprep(char(string(dec2missing5(748))),'^0*',''),'1021'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test9 (line 1) assert(isequal(regexprep(char(string(dec2missing5(1249))),'^0*',''),'1738'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test10 (line 1) assert(isequal(regexprep(char(string(dec2missing5(1873))),'^0*',''),'2611'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test11 (line 1) assert(isequal(regexprep(char(string(dec2missing5(2790))),'^0*',''),'3840'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test12 (line 1) assert(isequal(regexprep(char(string(dec2missing5(3035))),'^0*',''),'4142'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test13 (line 1) assert(isequal(regexprep(char(string(dec2missing5(3391))),'^0*',''),'4688'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test14 (line 1) assert(isequal(regexprep(char(string(dec2missing5(3547))),'^0*',''),'4881'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test15 (line 1) assert(isequal(regexprep(char(string(dec2missing5(3724))),'^0*',''),'6098'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test16 (line 1) assert(isequal(regexprep(char(string(dec2missing5(4057))),'^0*',''),'6608'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test17 (line 1) assert(isequal(regexprep(char(string(dec2missing5(4221))),'^0*',''),'6810'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test18 (line 1) assert(isequal(regexprep(char(string(dec2missing5(4389))),'^0*',''),'7017'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test19 (line 1) assert(isequal(regexprep(char(string(dec2missing5(4444))),'^0*',''),'7088'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test20 (line 1) assert(isequal(regexprep(char(string(dec2missing5(4489))),'^0*',''),'7138'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test21 (line 1) assert(isequal(regexprep(char(string(dec2missing5(4530))),'^0*',''),'7193'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test22 (line 1) assert(isequal(regexprep(char(string(dec2missing5(4533))),'^0*',''),'7197'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test23 (line 1) assert(isequal(regexprep(char(string(dec2missing5(4569))),'^0*',''),'7237'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test24 (line 1) assert(isequal(regexprep(char(string(dec2missing5(4585))),'^0*',''),'7264'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test25 (line 1) assert(isequal(regexprep(char(string(dec2missing5(4651))),'^0*',''),'7338'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test26 (line 1) assert(isequal(regexprep(char(string(dec2missing5(4680))),'^0*',''),'7380'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test27 (line 1) assert(isequal(regexprep(char(string(dec2missing5(5455))),'^0*',''),'8431'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test28 (line 1) assert(isequal(regexprep(char(string(dec2missing5(5711))),'^0*',''),'8846'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test29 (line 1) assert(isequal(regexprep(char(string(dec2missing5(5949))),'^0*',''),'9140'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test30 (line 1) assert(isequal(regexprep(char(string(dec2missing5(5999))),'^0*',''),'9206'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test31 (line 1) assert(isequal(regexprep(char(string(dec2missing5(6075))),'^0*',''),'9300'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test32 (line 1) assert(isequal(regexprep(char(string(dec2missing5(6526))),'^0*',''),'9961'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test33 (line 1) assert(isequal(regexprep(char(string(dec2missing5(6601))),'^0*',''),'10044'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test34 (line 1) assert(isequal(regexprep(char(string(dec2missing5(6634))),'^0*',''),'10091'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test35 (line 1) assert(isequal(regexprep(char(string(dec2missing5(6728))),'^0*',''),'10206'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test36 (line 1) assert(isequal(regexprep(char(string(dec2missing5(6787))),'^0*',''),'10281'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test37 (line 1) assert(isequal(regexprep(char(string(dec2missing5(6902))),'^0*',''),'10419'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test38 (line 1) assert(isequal(regexprep(char(string(dec2missing5(7037))),'^0*',''),'10689'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test39 (line 1) assert(isequal(regexprep(char(string(dec2missing5(7212))),'^0*',''),'10903'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test40 (line 1) assert(isequal(regexprep(char(string(dec2missing5(7493))),'^0*',''),'11246'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test41 (line 1) assert(isequal(regexprep(char(string(dec2missing5(7962))),'^0*',''),'11927'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test42 (line 1) assert(isequal(regexprep(char(string(dec2missing5(7996))),'^0*',''),'11974'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test43 (line 1) assert(isequal(regexprep(char(string(dec2missing5(8062))),'^0*',''),'12048'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test44 (line 1) assert(isequal(regexprep(char(string(dec2missing5(8109))),'^0*',''),'12110'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test45 (line 1) assert(isequal(regexprep(char(string(dec2missing5(8248))),'^0*',''),'12284'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test46 (line 1) assert(isequal(regexprep(char(string(dec2missing5(8427))),'^0*',''),'12603'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test47 (line 1) assert(isequal(regexprep(char(string(dec2missing5(8538))),'^0*',''),'12737'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test48 (line 1) assert(isequal(regexprep(char(string(dec2missing5(8620))),'^0*',''),'12838'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test49 (line 1) assert(isequal(regexprep(char(string(dec2missing5(8959))),'^0*',''),'13264'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test50 (line 1) assert(isequal(regexprep(char(string(dec2missing5(9190))),'^0*',''),'13641'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test51 (line 1) assert(isequal(regexprep(char(string(dec2missing5(9289))),'^0*',''),'13771'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test52 (line 1) assert(isequal(regexprep(char(string(dec2missing5(9436))),'^0*',''),'13944'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test53 (line 1) assert(isequal(regexprep(char(string(dec2missing5(9480))),'^0*',''),'14003'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test54 (line 1) assert(isequal(regexprep(char(string(dec2missing5(9533))),'^0*',''),'14072'))

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

Error using regexprep The 'STRING' input must be either a char row vector, a cell array of char row vectors, or a string array. Error in Test55 (line 1) assert(isequal(regexprep(char(string(dec2missing5(9541))),'^0*',''),'14081'))

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

Error using assert The condition input argument must be a scalar logical. Error in Test56 (line 1) for n=1:100, assert(all(char(string(dec2missing5(randi(10000))))~='5')); end

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

Error using deblank deblank only accepts character arrays with up to two dimensions. Error in str2double (line 42) s = deblank(s); Error in Test57 (line 1) x='1000'; for n=1:7, x=char(string(dec2missing5(str2double(x)))); end; assert(isequal(regexprep(x,'^0*',''),'11027'));

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

Error using deblank deblank only accepts character arrays with up to two dimensions. Error in str2double (line 42) s = deblank(s); Error in Test58 (line 1) x='234'; for n=1:10, x=char(string(dec2missing5(str2double(x)))); end; assert(isequal(regexprep(x,'^0*',''),'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');