Cody

Solution 2069216

Submitted on 26 Dec 2019 by Chua Chin Yie
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'))

3

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

16

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

21

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

99

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

111

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

388

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

1003

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

1021

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

1738

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

2611

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

3840

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

4142

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

4688

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

4881

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

6098

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

6608

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

6810

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

7017

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

7088

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

7138

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

7193

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

7197

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

7237

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

7264

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

7338

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

7380

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

8431

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

8846

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

9140

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

9206

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

9300

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

9961

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

10044

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

10091

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

10206

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

10281

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

10419

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

10689

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

10903

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

11246

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

11927

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

11974

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

12048

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

12110

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

12284

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

12603

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

12737

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

12838

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

13264

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

13641

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

13771

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

13944

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

14003

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

14072

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

14081

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

398 2271 10909 7241 920 8411 11209 14223 8910 10631 4420 14388 3620 3379 12128 1122 10680 6212 7463 133 13123 8638 11718 6168 326 8226 1828 6403 8103 12718 13712 7367 11624 10266 6740 9488 11313 1201 9313 8648 10334 12890 969 11841 13841 10937 9076 8434 11874 2419 13316 680 9022 12364 10736 7628 4374 14228 8428 12129 13976 6273 8889 10080 11194 7903 10672 931 7666 12709 3142 12370 10334 8826 6628 3410 1161 7781 3037 13387 10423 8776 3009 12617 8490 6336 334 12094 7722 4662 8268 9721 9420 8174 2489 6338 10378 14341 14690 12136

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

1331 1839 2473 3348 4630 7314 11027

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

290 362 442 641 892 1201 1684 2281 3114 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');