Cody

Problem 1901. GJam 2014 China Rd A: Read Phone Number

Solution 492070

Submitted on 27 Aug 2014
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
%% tic zstr='1'; zv=[1 ]; vexp='one'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

2   Pass
%% zstr='22'; zv=[2 ]; vexp='double two'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

3   Pass
%% zstr='333'; zv=[3 ]; vexp='triple three'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

4   Pass
%% zstr='4444'; zv=[4 ]; vexp='quadruple four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

5   Pass
%% zstr='55555'; zv=[5 ]; vexp='quintuple five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

6   Pass
%% zstr='666666'; zv=[6 ]; vexp='sextuple six'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

7   Pass
%% zstr='7777777'; zv=[7 ]; vexp='septuple seven'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

8   Pass
%% zstr='88888888'; zv=[8 ]; vexp='octuple eight'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

9   Pass
%% zstr='999999999'; zv=[9 ]; vexp='nonuple nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

10   Pass
%% zstr='0000000000'; zv=[10 ]; vexp='decuple zero'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

11   Fail
%% zstr='1111111111'; zv=[1 1 1 1 1 1 1 1 1 1 ]; vexp='one one one one one one one one one one'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

12   Fail
%% zstr='1111111111'; zv=[1 2 3 4 ]; vexp='one double one triple one quadruple one'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

13   Fail
%% zstr='6701604014'; zv=[1 4 5 ]; vexp='six seven zero one six zero four zero one four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

14   Fail
%% zstr='4096453178'; zv=[8 2 ]; vexp='four zero nine six four five three one seven eight'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

15   Fail
%% zstr='5418148180'; zv=[5 3 2 ]; vexp='five four one eight one four eight one eight zero'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

16   Fail
%% zstr='2319652041'; zv=[8 2 ]; vexp='two three one nine six five two zero four one'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

17   Fail
%% zstr='9645684646'; zv=[6 2 1 1 ]; vexp='nine six four five six eight four six four six'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

18   Fail
%% zstr='4508456969'; zv=[5 3 2 ]; vexp='four five zero eight four five six nine six nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

19   Fail
%% zstr='1839791609'; zv=[5 1 3 1 ]; vexp='one eight three nine seven nine one six zero nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

20   Fail
%% zstr='9398750802'; zv=[1 1 1 4 2 1 ]; vexp='nine three nine eight seven five zero eight zero two'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

21   Fail
%% zstr='5263950835'; zv=[4 5 1 ]; vexp='five two six three nine five zero eight three five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

22   Fail
%% zstr='1456187089'; zv=[3 6 1 ]; vexp='one four five six one eight seven zero eight nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

23   Fail
%% zstr='64360690'; zv=[8 ]; vexp='six four three six zero six nine zero'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

24   Fail
%% zstr='7367'; zv=[2 1 1 ]; vexp='seven three six seven'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

25   Fail
%% zstr='2441739'; zv=[5 2 ]; vexp='two double four one seven three nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

26   Fail
%% zstr='7532179'; zv=[1 1 2 2 1 ]; vexp='seven five three two one seven nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

27   Fail
%% zstr='0850664'; zv=[3 4 ]; vexp='zero eight five zero double six four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

28   Fail
%% zstr='8013334'; zv=[5 2 ]; vexp='eight zero one double three three four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

29   Fail
%% zstr='0184088'; zv=[2 1 4 ]; vexp='zero one eight four zero double eight'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

30   Fail
%% zstr='706181428'; zv=[4 4 1 ]; vexp='seven zero six one eight one four two eight'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

31   Fail
%% zstr='98530'; zv=[5 ]; vexp='nine eight five three zero'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

32   Fail
%% zstr='29664'; zv=[5 ]; vexp='two nine double six four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

33   Fail
%% zstr='49502'; zv=[2 3 ]; vexp='four nine five zero two'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

34   Fail
%% zstr='15'; zv=[2 ]; vexp='one five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

35   Fail
%% zstr='562640038'; zv=[4 4 1 ]; vexp='five six two six four double zero three eight'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

36   Fail
%% zstr='1148979'; zv=[6 1 ]; vexp='double one four eight nine seven nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

37   Fail
%% zstr='79982'; zv=[3 1 1 ]; vexp='seven double nine eight two'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

38   Fail
%% zstr='769'; zv=[3 ]; vexp='seven six nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

39   Fail
%% zstr='1742234'; zv=[6 1 ]; vexp='one seven four double two three four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

40   Fail
%% zstr='81818447'; zv=[5 1 1 1 ]; vexp='eight one eight one eight four four seven'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

41   Fail
%% zstr='5'; zv=[1 ]; vexp='five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

42   Fail
%% zstr='86'; zv=[2 ]; vexp='eight six'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

43   Fail
%% zstr='0573913609'; zv=[6 1 2 1 ]; vexp='zero five seven three nine one three six zero nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

44   Fail
%% zstr='497772738'; zv=[1 3 2 3 ]; vexp='four nine double seven seven two seven three eight'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

45   Fail
%% zstr='2252931'; zv=[1 5 1 ]; vexp='two two five two nine three one'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

46   Fail
%% zstr='19664'; zv=[3 2 ]; vexp='one nine six six four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

47   Fail
%% zstr='566175'; zv=[5 1 ]; vexp='five double six one seven five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

48   Fail
%% zstr='92433'; zv=[4 1 ]; vexp='nine two four three three'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

49   Fail
%% zstr='912039567'; zv=[1 6 2 ]; vexp='nine one two zero three nine five six seven'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

50   Fail
%% zstr='4820841'; zv=[5 1 1 ]; vexp='four eight two zero eight four one'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

51   Fail
%% zstr='71'; zv=[1 1 ]; vexp='seven one'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

52   Fail
%% zstr='4690'; zv=[1 1 2 ]; vexp='four six nine zero'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

53   Fail
%% zstr='106624'; zv=[4 2 ]; vexp='one zero double six two four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

54   Fail
%% zstr='7900005'; zv=[6 1 ]; vexp='seven nine quadruple zero five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

55   Fail
%% zstr='407'; zv=[2 1 ]; vexp='four zero seven'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

56   Fail
%% zstr='7738672895'; zv=[8 1 1 ]; vexp='double seven three eight six seven two eight nine five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

57   Fail
%% zstr='027326244'; zv=[2 2 4 1 ]; vexp='zero two seven three two six two four four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

58   Fail
%% zstr='115855'; zv=[2 1 2 1 ]; vexp='double one five eight five five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

59   Fail
%% zstr='6553794'; zv=[5 1 1 ]; vexp='six double five three seven nine four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

60   Fail
%% zstr='426185417'; zv=[8 1 ]; vexp='four two six one eight five four one seven'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

61   Fail
%% zstr='31'; zv=[1 1 ]; vexp='three one'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

62   Fail
%% zstr='68'; zv=[1 1 ]; vexp='six eight'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

63   Fail
%% zstr='05658716'; zv=[4 4 ]; vexp='zero five six five eight seven one six'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

64   Fail
%% zstr='87'; zv=[1 1 ]; vexp='eight seven'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

65   Fail
%% zstr='99329'; zv=[3 2 ]; vexp='double nine three two nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

66   Fail
%% zstr='21'; zv=[1 1 ]; vexp='two one'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

67   Fail
%% zstr='82'; zv=[1 1 ]; vexp='eight two'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

68   Fail
%% zstr='3273256549'; zv=[8 1 1 ]; vexp='three two seven three two five six five four nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

69   Fail
%% zstr='4'; zv=[1 ]; vexp='four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

70   Fail
%% zstr='0'; zv=[1 ]; vexp='zero'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

71   Fail
%% zstr='780409'; zv=[4 1 1 ]; vexp='seven eight zero four zero nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

72   Fail
%% zstr='252966140'; zv=[4 3 2 ]; vexp='two five two nine double six one four zero'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

73   Fail
%% zstr='3416708243'; zv=[10 ]; vexp='three four one six seven zero eight two four three'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

74   Fail
%% zstr='715'; zv=[2 1 ]; vexp='seven one five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

75   Fail
%% zstr='714860127'; zv=[7 2 ]; vexp='seven one four eight six zero one two seven'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

76   Fail
%% zstr='148725'; zv=[4 2 ]; vexp='one four eight seven two five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

77   Fail
%% zstr='130'; zv=[2 1 ]; vexp='one three zero'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

78   Fail
%% zstr='59696645'; zv=[1 1 1 2 3 ]; vexp='five nine six nine six six four five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

79   Fail
%% zstr='221065'; zv=[2 2 2 ]; vexp='double two one zero six five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

80   Fail
%% zstr='57715162'; zv=[2 3 2 1 ]; vexp='five seven seven one five one six two'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

81   Fail
%% zstr='110'; zv=[2 1 ]; vexp='double one zero'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

82   Fail
%% zstr='7537367'; zv=[1 4 2 ]; vexp='seven five three seven three six seven'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

83   Fail
%% zstr='9526681205'; zv=[6 3 1 ]; vexp='nine five two double six eight one two zero five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

84   Fail
%% zstr='0818593729'; zv=[1 3 2 4 ]; vexp='zero eight one eight five nine three seven two nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

85   Fail
%% zstr='729800081'; zv=[9 ]; vexp='seven two nine eight triple zero eight one'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

86   Fail
%% zstr='2124'; zv=[1 1 1 1 ]; vexp='two one two four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

87   Fail
%% zstr='7045'; zv=[3 1 ]; vexp='seven zero four five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

88   Fail
%% zstr='6317406'; zv=[7 ]; vexp='six three one seven four zero six'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

89   Fail
%% zstr='922906835'; zv=[8 1 ]; vexp='nine double two nine zero six eight three five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

90   Pass
%% zstr='55'; zv=[2 ]; vexp='double five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

91   Fail
%% zstr='70985826'; zv=[3 2 1 2 ]; vexp='seven zero nine eight five eight two six'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

92   Fail
%% zstr='1619499314'; zv=[8 1 1 ]; vexp='one six one nine four double nine three one four'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

93   Fail
%% zstr='89375'; zv=[1 1 3 ]; vexp='eight nine three seven five'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

94   Fail
%% zstr='655162'; zv=[1 5 ]; vexp='six double five one six two'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

95   Fail
%% zstr='180902'; zv=[3 3 ]; vexp='one eight zero nine zero two'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

96   Fail
%% zstr='39106'; zv=[5 ]; vexp='three nine one zero six'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

97   Fail
%% zstr='82361352'; zv=[6 2 ]; vexp='eight two three six one three five two'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

98   Fail
%% zstr='39'; zv=[1 1 ]; vexp='three nine'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

99   Fail
%% zstr='63'; zv=[2 ]; vexp='six three'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp))

Error: Assertion failed.

100   Fail
%% zstr='16748'; zv=[5 ]; vexp='one six seven four eight'; vstr=Phone_CH(zstr,zv); assert(strcmp(vstr,vexp)) toc

Error: Assertion failed.