Cody

# Problem 2324. GJam 2014 Rd 1c: Train Cars

Solution 1678767

Submitted on 22 Nov 2018
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
s='iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj qqqqqqqqqqqqqnnnnnnnnnnnnnnnnnnnnnnnnnlllllllllllllllhhhhhhhhhhhhhhhhhh ssssvxxxxbbb uuuuuuuuuuuuuuuuuutttttttttttttttttttttttttffffffffffffffffffffffffffffff uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu gggwwwwwwwrrrrrraaaaoooooooppppppyyyyyyyeeeeeeeccccccccccdddddddmmmmmmmzzzzzzkkkk uuuuuuuuuuuuuuuuuuuuuuuuuuuuu'; Vexp=1440; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test1 (line 3) val=train(s);

2   Fail
s='ffvvuaaaaddbbbkzzz yynnneerrrxxxx iiiiiwqssssyy mmmmmmmmmggggggggg llltttpjjhhoo'; Vexp=24; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test2 (line 3) val=train(s);

3   Fail
s='sssssssssssssssssss wwuuunnnmmgggggpzz kkkhhhdddjjqfxxaaye ttttttt oooooooooooooooooooo'; Vexp=120; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test3 (line 3) val=train(s);

4   Fail
s='ssssssssssssssssssss zzkkkkkeuuiii gyyynnffpooxhhhjtt lllllllcccc dddddddwwwwwmmmaaa cccbbbrrrrrrrrrr'; Vexp=120; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test4 (line 3) val=train(s);

5   Fail
s='uueeennnbbdjjxx oooooooogg sssssaaaaaww iiiiiiiiiiiii yyssss iiiirrrryyyyy ggghhhfiii kkkqqqqzzzzzzzmmmm pppppppppccccc'; Vexp=24; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test5 (line 3) val=train(s);

6   Fail

Undefined function 'train' for input arguments of type 'char'. Error in Test6 (line 3) val=train(s);

7   Fail
s='wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww wwww sssssssssssssssssssssssssssssssssssssssssssss hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh llllpppppppppeeeeeeejjjjjjjmmmmoooggkkkkdddddbbbxxxxxfffffffvvvvtttaazzzzzzuuuuuuuuucc wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii wwwwwwwwwwwwwwwwwyyyyyyyyyyyyyyyyyyyyyyyyyyyyyynnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnniiiiiiiiiiiiiii'; Vexp=1440; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test7 (line 3) val=train(s);

8   Fail
s='cd bc ab'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test8 (line 3) val=train(s);

9   Fail
s='ggggggggggggggg hhhhwzziiiiyyyyaaaa gggggggggg bbbbbbbbbbbbbb spjttfllllnncqr kkkkkdddddeeeeevvvvv ggggggg mmmmmmmmmmmmm gggggggggggg'; Vexp=17280; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test9 (line 3) val=train(s);

10   Fail
s='iilhzzattttdddjjkk wwwwwwwww uuuuuuiiiiiiiiii fggbn xxxxxxxxxxmmmmm'; Vexp=24; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test10 (line 3) val=train(s);

11   Fail
s='tttvvsqqrrrriicccc aaaaaaaaaaaaaaaaaa ggggggggggxxxxxxxxx hheefyyydd zzzzzzzznnnnllllmmmm wwuuuk jjjjj ddddddppppppppp mmmmmmmooooooooo pppppbbbbbbbjjjjjjjj'; Vexp=720; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test11 (line 3) val=train(s);

12   Fail

Undefined function 'train' for input arguments of type 'char'. Error in Test12 (line 3) val=train(s);

13   Fail
s='mmmmmmmmmmmmmmmmmmmmmddddddddddddddddd mmmmmmmmmmmmmmmmmmmmm ddddddddddddddjjjjjjjjjjjjjjrrrrrrrrrrrrrrrrrrrrrrttttttttttttttttt ttttzzzzzzzzvvvvvvvvhhhhhhhhccccllllllllyyyyyyaaaaeeeeeeeeiiiiiiiiii iiiiiiiiwwwwwwwooooooooppppkkkkk'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test13 (line 3) val=train(s);

14   Fail
s='bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ttttttttttttttttttttllllllllllllllllllllllllllllccccccccccccccccccccccccccccooooooooooooooooooooooo iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiisssssssssssssssssssssssssssssss bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb gggggxxxxxxrrrrnnnnnnnnmmmmkkkkuuuuuuuuyyyyyhhheeeezzzzffffffffjjjvvvvv bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb qqqqqqqqqqqqqqqqqqqqqqqqqqqqqaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ppppppppppppppppppppppppwwwwwwwwwwwwwwwwwwwwwwwddddddddddddddddddddddd'; Vexp=17280; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test14 (line 3) val=train(s);

15   Fail
s='ggggpttt iiiiiiiiii iiiiiiiiiiiiiiiiiiii iiiiiiiiiiiiiii fffffffffkkkkkkkkkaa vwwnjssbbbhxxxqqr lllllccccmmuuuuu iiiiiiiiiiiiiiii iiiii'; Vexp=14400; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test15 (line 3) val=train(s);

16   Fail
s='kavdczugmoesxvalrdmkcpowwxcnhumcfkzakzbdftweqhxmcfrkziqbyoeziuvitserfjiggoubonggswxlkpkoundgmayxiapv'; Vexp=0; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test16 (line 3) val=train(s);

17   Fail
s='abc'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test17 (line 3) val=train(s);

18   Fail
s='iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii mmmmmmmmmmmmmmvvvvvvvvvvvvvvvvrrrrrrrrrrrruuuuuuuuuuuuuuussssssssssssssssssnnnnnnnnn ffffkwweeebbbbccctttppjjjggggggaaaayyddddddxxxxxx hhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhh iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiihhhhhhhhhhhhhhh'; Vexp=12; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test18 (line 3) val=train(s);

19   Fail
s='cclevhhpn ywuuccc'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test19 (line 3) val=train(s);

20   Fail
s='jjjjjjjjjjhhhhhllllllltttttmmmmmmmmmkkkkkkoooyyyyyyyyyyyycccccnnnnzzzzzzssssssbbbbbbbbbbgggggggg uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwweeeeeeeeeeeeeeeeeeee rrrrrrrrrrrrrrrrrrrrrraaaaaaaaaaaaaaaaaaaaaaaaaaxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq eeeeeeeeeeeeddddddddddddqqqqqqqqqqqqqqqq uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu'; Vexp=24; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test20 (line 3) val=train(s);

21   Fail
s='yyxxxmmmmhhhhhuuuujjlllllliiiiiieeeccccggbzzzzaaafff wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww vvvvsssssskkkknn rrrrrrrrrrrrrrrrrrrrrqqqqqqqqqqqqqqqqqqqqpppppppppppppppppp ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo tttttttttttttttttttttttttttttttttttttttttttttttttttttt tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt dddddddddddddddddddddddddddddddddddddddddddddddddddddddddd'; Vexp=10080; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test21 (line 3) val=train(s);

22   Fail
s='qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr vvvvvjjjjggggggmmmmmlllllppppppppfffffiiiiiiiidddddddeeeezsssssbbbbbbuuuuu qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq'; Vexp=2; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test22 (line 3) val=train(s);

23   Fail
s='xxxvvvvaaaaylsqqkg ddcccpttmm nnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnn jjjjjuuuuhhhhhhhh ziiiddddd'; Vexp=48; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test23 (line 3) val=train(s);

24   Fail
s='g i uvbm iog k rdi'; Vexp=6; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test24 (line 3) val=train(s);

25   Fail
s='ccaallttwniiiiiixxhh rrrrfffffbbeeeuuuuuuuggggggyycccc sssssssssssssssvvvvvvvvvvvvvvrrrrrrrrrrrrrrrrrrr'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test25 (line 3) val=train(s);

26   Fail
s='rrrrrrkkkkknnnnnnllsssssssssssssscccccccppppppddddddddmmmmmmwwwwwwqqqqqqiiitttttttjjjjjjjjjjj uuuuuuuuurrrrrrrr'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test26 (line 3) val=train(s);

27   Fail
s='ttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh vzaaappssooookkkkyyyyffbbbwwwiiiiiiiirrrllqqqqeexxddnncg mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj'; Vexp=24; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test27 (line 3) val=train(s);

28   Fail
s='ccccccccccccccccccccccccccccccccccccccccccccccczzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz wwwwwwwwwwffffffffffffffffppppppppppppppppppccccccccccc'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test28 (line 3) val=train(s);

29   Fail
s='zzzzzzzzttttttttttthhhhhhhxxxxxxbbbbbbbwwwwwwwyyypppooooorrrnnnnnnuuuggaammmmmkkkkkccccvvvvvllllllll iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss'; Vexp=40320; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test29 (line 3) val=train(s);

30   Fail
s='eeeeeeeeeeeeee hhhhhhhh xxxxxxxxxxxxxxxxxxxx iiiaanwwwrrbbbb hhhhhhhuuuuuuuuuuu dddddddtttttttttiiii gggggggggzzzzzzz qqqqccfvvvoyyykjjmm bblllllppppp'; Vexp=720; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test30 (line 3) val=train(s);

31   Fail
s='ttttttttttttttttttttttttttttttttttttcccccccccccccccccccccccccccccccccccccccc ttttttttttttttttttttttttttttttttttttttttttttttt ccccccccccccccccccccccccccccccc pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp ppppppppppppppppppppp ccccccccccccccccccccccccccccccccccccccccccc pppppppppppppppppppppppppppppppppppppppppppppppppppp pppppppppppppppppppppppppppppppppppppppttttttttttttttttttttttttttttttttttt pppppppppppppppppppppppppppppppppppppp'; Vexp=48; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test31 (line 3) val=train(s);

32   Fail
s='abc bcd'; Vexp=0; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test32 (line 3) val=train(s);

33   Fail
s='eeeeeeeeeeeeeeaaaaaaaaaaaadddddddddddddddd zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz wwwwwwvvvvvqqqqqqqqyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyylllllllllllllllluuuuuuuuuuuuuuuuuuuuuuuuuzzzzzzzzzzzzzzzzzzzzzzzzzzzz ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff eeeeeeeeeeeeeeeeeeeee rrrrrrrrrrrrrrrrkkkkkkkkkkkkkkkkkkkkkkkk dnnnnnnnnnpppppxxxxxxffffffff'; Vexp=6; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test33 (line 3) val=train(s);

34   Fail
s='mmmmmmmffffffffffffkkkkkkkkkkkkkkkkkkkdddddddddddddd oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo oooooooooooommmmmmmmmmmmmmmmmmmmmmm'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test34 (line 3) val=train(s);

35   Fail
s='eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeennnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee'; Vexp=720; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test35 (line 3) val=train(s);

36   Fail
s='ggggggggqqqffffffmmmiiiiiiiuuuuuuueeeeeeyyyyyyddddddddkkkkkkvvvvvvvrrrrppllllllllbbbbbwwwwwwwwjjjjjj xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhzzzzzzzzzzzzzzzzzzzzzzzzzz aaaaaaaaaaaaaaaaaaaaaaaaaaaaaassssssssssssssssssssssstttttttttttttttttttttttnnnnnnnnnnnnnnnnnnnnnn'; Vexp=6; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test36 (line 3) val=train(s);

37   Fail
s='bbbbbuuuuussfffffvvvkkhhheeeyyyyyjjqqqqqnnn ddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd llllllllllllllllllllllllllllllllllllllllwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww ggggggmmmmmmmmmmmmiiiiiiiiiaaaaaxxxxxxxxzzzzzzzzzzzooooooooo'; Vexp=24; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test37 (line 3) val=train(s);

38   Fail
s='bbbbbbbbbbbbbbbbrrrrrrrrrrrrrrrrrrvvvvvvvvvvvvvvvvvvvvssssssssssssssssssssswwwwwwwwwwwwwwlllllllll uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu qqq yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyykkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk cccccccccoooooppppppppppppppjjjjjjjjjjjqqqqqq kkehhhhxxxftiiib qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqddddddddddddddddddddddddddddnnnnnnnnnnnnnnnnnnnnnnnnnnnnn uuuuuuuuuuuuuuuuuuuuuuuuuuuuuccccccccccccccccccccccccccccc nnnnnnnnnnnnnnnnnnnnnnnnnnnnmmmmmmmmmmmmmmmmmmmmmggggggggggggggggyyyyyyyyyyyyyyyyyyyyyyyyyy'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test38 (line 3) val=train(s);

39   Fail
s='jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjggggggggggggggggggggggggggggggggggaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa hhhhhhhhhhhhhhh zzzzzzzzzzzzzzzzzzzzvvvvvvvvvvvvvvvvuuuuuuuuuuuuuuuuuuuuuuuupppppppppppppooooooooooooooooooooooo hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhh iiiiiiiiiiiiiiiiiiiiiiiiiiiiinnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnneeeeeeeeeeeeeeeeeeeeeeeeeeeeeee hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh wwwwccccffffrrqqqqqqbbttttttdddddddxxxllllllllllyyyyyyyymmmmmmkkkkkksssssss'; Vexp=86400; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test39 (line 3) val=train(s);

40   Fail
s='uuuuuuuyyyyyddddddddqqqqqttttttbbbiiiiiiiaaahhh ooooooooogggggguuuuuuuuuu'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test40 (line 3) val=train(s);

41   Fail
s='ggggggoooooeeeyjjqqqqqqq mmmmmttttddddddrrraaaaaaaaallllllllzzzzzzzzzzzznnnnnnnnnnnnnnwwwwwwwggggg'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test41 (line 3) val=train(s);

42   Fail
s='kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx eeeeeaaaaaaaaaawwwwwwwwwwwwzzzzzzzzzzzzzsssssssssssssssqqqqqqqqyyyyyyyyyyyyyyyvvvvvvvvvvvvvvffff dddddddddddddddddddddddddddddddddhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh jjjjjjjjjjjllllllllllllllllllloooooooooooooooooooooooooocccccccccccccccccccrrrrrrrrrrrrrrrrrrrr ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg'; Vexp=120; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test42 (line 3) val=train(s);

43   Fail
s='aa aa bc'; Vexp=4; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test43 (line 3) val=train(s);

44   Fail
s='kkkkkkrrynnn vvvvvvvvvvvvvvvvvvvv jhhppibllllddddaooff nqqqwwwwwsss xmmmmmmmtttucc zzzzzzzzzzzzzzzzzzzz eeeeeeeeeeeee'; Vexp=720; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test44 (line 3) val=train(s);

45   Fail
s='fffffffffffffffffffffffffffffffffffffffffffffffffffffeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee ccccccccccccccccccccccccccccccc ooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyygggggggggggggggggggggggggggggggggggg sssssssshhhhhhhhhhhhhhhhzzzzzzzzzzzzzooo nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnssssssssssssssssssssssssssssssssssssssssssssssss sssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss jjjjjxxxxrrriiitttttttwwwwpppppkddddddddqqqqaaaaallllllvvbbuuuuummmm nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn'; Vexp=120; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test45 (line 3) val=train(s);

46   Fail
s='yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuukkkkkkkkkkkkkkkkkkk xxxxxxxxxxxxxvvvvvvvvvvvvvveeeeeeeeeeeeeeeeeegggggggggggg mmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm ppppppppwwwwwwwiiiiiiiiiqqqqqsssaaaaaaaaalllllllllttttnnnnnnnddddddddhhhhhhhjjjjjjjrrrrroooooooo kkkkkkkkkkkkkkkkkkkkkkk zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzyyyyy cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk'; Vexp=240; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test46 (line 3) val=train(s);

47   Fail
s='rrrrrrrbbbbbbbbb sslll rrrrsss mmmmmmddddd lllllllooo ooooooommmm'; Vexp=0; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test47 (line 3) val=train(s);

48   Fail
s='eeeeeeeeeeeeeeeeee xxmmmmm rrrrrrrrrrrrrr iiiii hhgdddfccbbqqqnniii ppppppppppppppp aayyyy oooooooooooooooooooo wwvsssszzzkkttllljjj uuuuuuuuuuuuuuuu'; Vexp=362880; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test48 (line 3) val=train(s);

49   Fail
s='jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj jjjj'; Vexp=6; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test49 (line 3) val=train(s);

50   Fail
s='xxxxxxxx xxxxxxx iiavvvvppjjnnnzzzr gkkkuuwwsscccmmmmeed hhhqqqqqqqqqoooooo llllllllxxxxxxx bbyyttttttffffff'; Vexp=240; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test50 (line 3) val=train(s);

51   Fail
s='kkkkddddmmccssbb ppppppppppppp rryyyyyyqiiezzuhhx wwwwwwwwww ppppppppp aaaaaaooooooooo jjjjjjjjjjjjjjjjjjj ffffffffffffffffffff ggggggggvvvvvvtttttt lllllllnnnnnnnnnnnnn'; Vexp=725760; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test51 (line 3) val=train(s);

52   Fail
s='aaaaaaaaaaaaaaaaaaavvvvvvvvvvvvvvvvvvvvv vvvvvvvvvvvvqqqqqqqqqqqqqqqkkkkkkkkkmmmmmmmmmm mmmppppppppppppppxxxxxxxxxxxxxxxxxxxxcccccccccyyyyyyyyyyyyyyeeeeeeeeeeeeehhhhhhhhh'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test52 (line 3) val=train(s);

53   Fail
s='zzzzzzzzzccccccccccchhhhhhhhhhffffffffffdddddddddaaaaaaaaavvvvvvvvvvvvvv rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr rrrrrpppppppppppppmmmmmkkkkkkkkkkooooooooonnnnnnnntttttteeeeeellllljjj'; Vexp=2; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test53 (line 3) val=train(s);

54   Fail
s='zzzzzzzzzzzzzzzzz nnnffooqqqsdeeegrrmm hhhhhhhhhcccccccccc wwwwwwwwwwuuuuuuuuuu jlllkkkx cccccaaaaapppijjjjj bbbbhhhhhhhhhhhhhh yyyyyyyvvvvvvvvvvvv'; Vexp=120; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test54 (line 3) val=train(s);

55   Fail
s='ccccccccccccccc bbbbbbbbbwwwwwwww lllllllllllll peezzzuuiisoodtttfff mmmmmmmmmmmmmmmmm qqqyyyyyyyyyrr'; Vexp=720; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test55 (line 3) val=train(s);

56   Fail
s='tqqxvveggggccdda oooott'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test56 (line 3) val=train(s);

57   Fail
s='qqqqwwooooommhhhhhhhhlllllllsssssddddnnnniiiiiexxxxxxxxxttttffyyyyyyyybbbbbccggggggkkkkk qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test57 (line 3) val=train(s);

58   Fail
s='cccccccccccccccfffffffffffffffffffffggggggggggggmmmmmmmmmmmmmmmmmmoooooooooooqqqqqqqqqqqqq uuuuuuuuuuuuuuuuuuuuuuubbbbbbbbbbbbbjjjjjjjjjjjjjdddddddddddddddddd qqqqqqqqqqqqnnnnnnnnnnnnnnnnnnnnnkkkkkkkkkkkkkkkkkkkkkkk kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkttttttttttttttttttttttttttttttttttttttaaaaaaaaaaaaaaaaaaaaaaaaaa'; Vexp=2; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test58 (line 3) val=train(s);

59   Fail
s='ccccccccgggggggggggg wwwwww oooooooooo zzzzzzzzzzzzzzz rrttttttfffmm hhhhhhhhhbbbbvvvvvv xxxlnnpssddddijaoo yyyyyyyyyyyyyyyyy'; Vexp=5040; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test59 (line 3) val=train(s);

60   Fail
s='p'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test60 (line 3) val=train(s);

61   Fail
s='qqqgguuuuctmmmmddjor rrrrrrrrrrrrrrrrrr'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test61 (line 3) val=train(s);

62   Fail
s='ab ab'; Vexp=0; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test62 (line 3) val=train(s);

63   Fail
s='qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqfffffffffffffffffffffffffffffffffffffffffff rrrrrrllllllllllyyyyyy oooooooooooovvvvvvvvvvvvvvvvvvviiiiiiiwwwwwwwwwwwwwwcccccccccccccc mmmmmmmmmmmmmmmzzzzzkkkkkknnnnnnnnnbbbbbbbbaaaaaaaaaa aaaaaappppppgggggggghhhhhhhhhhhqqqqqqqqqqqqq ttttttttttttttttttjjjjjjjjjjjjjjjjjjjjuuuuuuuuuuuuuuuuuuuuuussssssssssssssssss fffffffeeeeeexxxxxttt yyyyyyyyyyyyyyyyyyyyyyydddddddddddddddmmmmmmmmmmmmmmmmmmmmmm'; Vexp=2; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test63 (line 3) val=train(s);

64   Fail
s='uuuucccccccccccxxxxxxxxxxxxxx nnnnnnnnffffflllllllliiiiiiihhhhhhzzzzzzzzzzzzeeeeeeeeeeqqqqqqq kkkkkkkkkkkkkkkggggggggggggggggggggggaaaaaaaaaaaaaaaaaaaaauuuuuuuuuuuuuuuuuuuuuuuuuuu'; Vexp=2; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test64 (line 3) val=train(s);

65   Fail
s='nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn hhhhkkkkkkkkkkkkkaaaaaaaoooooommeeeeeevvvvvvvvzzzzxxxxxxxxrrrrrrr lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll ccccccccyyyyyuuuuuuiiqqqqqqqqqqddddddjjjjjtttttttbbbbbffffssssswwwwwwwwwgggppppppp'; Vexp=24; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test65 (line 3) val=train(s);

66   Fail
s='mmmmmmiiiii cccccccccccccccccccc hhhhhhhhhhhhhhhhh aooryzzkvvvblffff cccccccpppppqqqqq'; Vexp=24; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test66 (line 3) val=train(s);

67   Fail
s='cccccccccc ccjjill'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test67 (line 3) val=train(s);

68   Fail
s='dddrrnnnnnj pppppvvvvmmmmmmoo ttttttttttttttt jjjjjjjjiiiiiiiii uullwaaaagykxxxxbe iiiiiiiiiiizzzzzzz ffffffffffssssssss'; Vexp=120; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test68 (line 3) val=train(s);

69   Fail
s='abc a a'; Vexp=2; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test69 (line 3) val=train(s);

70   Fail
s='qqeebbccggy uuuuufff snittojvwwwpx ddddaaaaaaaammmmmmm rrrrrrrrrrrr fffllllllhhzzzddddd'; Vexp=24; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test70 (line 3) val=train(s);

71   Fail
s='nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn gggggooojjjuuuummmmrrrrrttppppwwwwwaaaaaahhhhhhfffffkkkbbbbccccceeeezzzvvv nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn nnnnnnnnnnnnnnnnnnnnnnnnnnnnnn'; Vexp=80640; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test71 (line 3) val=train(s);

72   Fail
s='eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeezzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz nnnnnnnnnnnnnnnsssssssssssssiiiiiiiiiuuuuuuuuuuuuuuuuu lllllllllllllffffffffffvvvvvvvgggggghhhhhhhh bbbbrrrrrqqqqwwwwmmkkkoooooaaayy hhhhhhhhhhhhhxxxxxxxxxxxxxppppppppppppppppppppptttttttttttttttttteeeeeeee'; Vexp=6; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test72 (line 3) val=train(s);

73   Fail
s='gggggggggtttttttqqqqqqxxxxxxxxkkkkkkkkyyyymmmmmmmmmwwwwwwwoooooooooooooeeeeeee pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp ssssssssssssssssssssssssssssssssssssssssssssssssssssssss iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd fffrrraahhhhhlllllccbbbbvvzz jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu'; Vexp=362880; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test73 (line 3) val=train(s);

74   Fail
s='wwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwww xxxxxxxxxxxxxxxxxxxxxxxxxxxooooooooooooooooooooooooooooobbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb fffiiaaauuurrrddeevvvhhhhgqqqcccccnnnpyyyyssmmmmtzkkkk jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj lllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllllll'; Vexp=120; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test74 (line 3) val=train(s);

75   Fail
s='a ca a abc'; Vexp=0; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test75 (line 3) val=train(s);

76   Fail
s='llllllllllllllllllllllllllllllllaaaaaaaaaaaaaaaaaaaaaaaaaaaa bbbbbbbbbbbbbbbbbbbbbbbbbbbfffffffffffffffffffffffffffffffffffllllllllllllll vvvvvvvvvvvvvvvjjjjjjjjjjjjjjjjjjjjooooooooodddddddddddddwwwwwwwwwwwwwwnnnnnnnnnnnnnnnnnnnnn eeeeeeeeeeeeeeeeeeeeeeeeeepppppppppppppppppppp syyyyyyyytthhhccczzzzrrrrrggqqkkkxxuuuummmmmiii ppppppppppppppppppppppppppppppppbbbbbbbbbb'; Vexp=6; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test76 (line 3) val=train(s);

77   Fail
s='oooooooooooooooooooooooooooaaaaaaaaaaaaaaaaaaaaaaaaaaiiiiiiiiiiiiiiiiiiiiiiiiiii qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq eekrrrwsnnnngggddxczffmmhhhpvvvvttjlllbbb uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy'; Vexp=24; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test77 (line 3) val=train(s);

78   Fail
s='vvvvvvvvvvvvvbbbbbbbbbbbbbbbbbbsssssssssssssfffffffffppppppppppppppplllllllllllllllll ttttzzzzzzzzzyyyyyaaaaooooooiiiiiiiiiinnnjjjjjjjjmmmmdddddddgggcccccxxxxxeeeeeeeeeeqqqqqhhhhrrrrrr'; Vexp=2; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test78 (line 3) val=train(s);

79   Fail
s='xx fffffrrrrrrrrrrrr xssssttwwwf rrr ffffffffff'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test79 (line 3) val=train(s);

80   Fail
s='nnnnnnnnnnnnnnnnnnnn ttttttttttt fffffffffffffffffff ffffffffffffffffffff lgggccccbyyy yhaqqqmooo pppkkkeeerrrrrr'; Vexp=240; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test80 (line 3) val=train(s);

81   Fail

Undefined function 'train' for input arguments of type 'char'. Error in Test81 (line 3) val=train(s);

82   Fail
s='ggggjjdddiiiixxxyyy pppppppppppppp ooooooooooooo lllllllllllll ebshuuuufffmaaawvvv ttttttttttttttt zzzzzzzzzzzzzzzzzz cccccccccccccccccccc ppppppppppppppppppp qqqqqqqqqqq'; Vexp=725760; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test82 (line 3) val=train(s);

83   Fail
s='tttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttttt kkiiiillxxxddwwwwmmmfffqqeeuuhhhnnnnsssssbbbbpppjjya'; Vexp=2; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test83 (line 3) val=train(s);

84   Fail
s='rrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrr'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test84 (line 3) val=train(s);

85   Fail
s='gggggggggggjjjjjjjjjkkkkkktttttttthhhhhyyyyyyyyyyppppppppppaaaafffffffffffffffvvvvvvvrrrrrrrr uuuuuuuuuuuuuqqqqqqqqqbbbbbbbbbbbbdddddddddwwwwwwwwwwwwzzzzzzzxxxxxxxxeeeeeeeeeeeennnnnnnlllllllllll rrrrrrrrrrrrrrrrrrsssssssssssssssmmmmmmmmmmmmmoooooooooooooccccccccccccc'; Vexp=2; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test85 (line 3) val=train(s);

86   Fail
s='rrrrrrzzzzzz wwwwwwwwwwwwwwww uuuuuaaaaaa lllllllllllllllll ggggggggiiiiiiiiii hhhhhhhhhhhhhhhhhhhh qqssjjjmmfttecddd bbbbnnvpyyykkkxxoo'; Vexp=40320; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test86 (line 3) val=train(s);

87   Fail
s='dddddddddddddddddddddddeeeeeeeeeeeeeeeeeegggggggggjjjjjjjjjjjjjjfffffffffff bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb ttttttppppphhaaqqqqqxxxxxiiiiiiuuuuucccccmmmsszzzzznnnnnnn yyyyyyyyyywwwwwwwwwwooooooooooorrrrrrrrrrvvvvvvvvvvvvvvvvvddd kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkklllllllllllllllllllllllllllllllllllllllllllllllllllll'; Vexp=24; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test87 (line 3) val=train(s);

88   Fail
s='jw ki ij'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test88 (line 3) val=train(s);

89   Fail
s='yooccccgdexxmmrz wwwwwaaaiiiiii lllllllllllllllllll bbbbbbbbnnnn llllll ppppppppppppppppppp kkkhhhhhttttttjjj'; Vexp=1440; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test89 (line 3) val=train(s);

90   Fail
s='uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuujjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj xxxxxxxxxxxttttttttttttttttaaaaaaaaahhhhhhhhhhhhhhhzzzzzzzzzzzzzzuuuu'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test90 (line 3) val=train(s);

91   Fail
s='rrrrrpppppppp oooooooooooooooooooo ggqqwwwssmmjjahuun'; Vexp=6; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test91 (line 3) val=train(s);

92   Fail
s='yyyyyyyyyyyyyyyyyyyeeeeeeeeeeeeeeeeeeeedddddddddddddddddddrrrrrrrrrrrrr pppppppppppppppppppppppppppppppppppppppppppppppppppppp rrrrrrrrrrrrrrrrrrrrrrrrrvvvvvvvvvvvvvvvvvvvvvvvvvvvv vvvvvvvvzzzzzzzzzzzzzzzzssssssssssssppppppppp xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxooooooooooooooooooooooooooooooooooooooooooooo ppppppppppppppppppp pppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppppp ppppppppppppppppppppppbbbbbbbbbbbbbbbbbbbbbbiiiiiiiiiiiiiiiiiiiiiiiiiixxxxxxxxxxxxxxxxxxxxxxx'; Vexp=6; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test92 (line 3) val=train(s);

93   Fail
s='rrrrrrrrrrrrrrrrrrrrrrrrrrrrrcccccccccccccccccccccccc dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb oooooooooooooooooooooooaaaaaaaaaaaaaaaaaa sssgggggggglllllmmmmttttttttttttzzzjjjjjjjpppphhhhhyyyyyiiiiiixxxxxeeekkkkkkkkkfffffffuuuuuuuuwwwwww vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv nnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn'; Vexp=5040; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test93 (line 3) val=train(s);

94   Fail
s='xxxxxmmmmmwwwwwws yyyyyyqqqqqqqq pppppppppppppppppp llllllllllllllllll vvvvvvvvvvvvvvvvv eeeeeeeeeeeeeeeeeee aaaaaaaaaaaaaaa ggggggggggggggggggg shhhodrrruuutt'; Vexp=40320; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test94 (line 3) val=train(s);

95   Fail
s='kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj nnnnnnnnnggggggggmmmmmmmaaaaaattttttttttttwwwwwwwweeeeeeeeuuuuuuuuqqqqqqfffffffooooooo zzzzzzzzddddddddddvvvvvvv pppppppxxxxxxxxxxxxxrrrrrrrrrriiiiiiiiiiiiiikkkkkkk ppppppppppppppppppppppppppppppppppppppppppppp yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv hhhhhhhhhhhhhhhhhhhhhbbbbbbbbbbbbbbbbbbbbbbppppppppppppppppppppppppp'; Vexp=2; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test95 (line 3) val=train(s);

96   Fail
s='cccccccccccc qqqqqqqqqqqqqqqqq rrrrrr yyyyyyyyyyyyyyyy mmmmmmmmmmmmmmmmmmmm rrrrrrrrrrrrrr tttpajjibbuuuzfooo dddddddddddddd ssssswwhhheeelnnkkk rrrrrrrrrr'; Vexp=241920; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test96 (line 3) val=train(s);

97   Fail
s='uummmmslzaaaddprqqqq kkffff jjjjjjjjjjjjjjjj kkkkkkkkkkkkk kkkkkkkkkkkkkkkkkkk'; Vexp=12; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test97 (line 3) val=train(s);

98   Fail
s='zzzzzyyyyyy nnoooooalllkkswwwf fch'; Vexp=2; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test98 (line 3) val=train(s);

99   Fail
s='sssssssssssssssssssssssssssssssssssssssssssssssssssssssaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa ttttttttttttttttttss'; Vexp=1; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test99 (line 3) val=train(s);

100   Fail
s='fffffffffffffffffffffffffffffffffffff fffffffoooooosssssssssssdddddddddddddddiiiiiiiiiiiiiiiiiiyyyyyyyyyyyyyyyyyyyyyzzzz zzzzzzzzzzzzz zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'; Vexp=4; val=train(s); assert(isequal(Vexp,val))

Undefined function 'train' for input arguments of type 'char'. Error in Test100 (line 3) val=train(s);

101   Pass
% Full GJam solution % function GJam_Rd1c_bv2 % % % trial = 1; % if trial == 1 % fin = 'B-small-practice.in'; % fout = 'B-small-practice2.out'; % elseif trial == 2 % fin = 'B-small-attempt0.in'; % fout = 'B-small-attempt0.out'; % elseif trial == 3 % fin = 'B-large-attempt0.in'; % fout = 'B-large-attempt0.out'; % elseif trial == 4 % fin = 'B-small-practice_tiny.in'; % fout = 'B-small-practice_tiny1.out'; % elseif trial == 5 % fin = 'B-large-practice.in'; % fout = 'B-large-practice.out'; % end % % [data] = read_file(fin); % % % fidG = fopen(fout, 'w'); % % tic % for i=1:size(data,2) % Cell array has N cols of cases % % val=train(data{i}); % %toc % fprintf('Case #%i: %i\n',i,val); % fprintf(fidG,'Case #%i: %i\n',i,val); % % % end % toc % % fclose(fidG); % end % % function val=train(s) % val=0; % % vstr=regexp(s,' ','split'); % % N=size(vstr,2); % % % create vs, ve, vinternal % % check if internals % vc=zeros(1,255); % common vector for overlaps % % for i=1:N % find starts/ends % s1=double(vstr{i}); % vs(i)=s1(1); % ve(i)=s1(end); % vc(vs(i))=1; % vc(ve(i))=1; % end % % for i=1:N % v=double(vstr{i}); % % [valid,vint]=check_vint(v); % % if ~valid,return;end % if any(vc(vint)),return;end % internal elsewhere or internal to a start/end % vc(vint)=1; % % end % i % % m=[vs' ve']; % % m=sortrows(m,[1 2]); % sort start then ends within start % % N=size(m,1); % % if two pices have same start or end and neither is an aa then Invalid % for c=1:2 % for i=1:N-1 % if m(i,1)==m(i,2),continue;end % schk=m(i,c); % for j=i+1:N % if m(j,1)==m(j,2),continue;end % if schk==m(j,c),return;end % end % j % end % i % end % c % % % Cases are valid, at least a 1 % %Q is PI(Ni!) for the i cases of aaa, bbb,... % %val=Q*Z! where Z is number of independent groups % % val=1; % % Zptr=N; % % % Aptr Zptr remove aa pairs and multiply by perms of aa sets % while Zptr>1 % Aptr=Zptr; % if m(Zptr,1)==m(Zptr,2) % valid aa event % qp=1; % while m(Aptr-1,1)==m(Aptr-1,2) && m(Aptr-1,1)==m(Zptr,1) % Aptr=Aptr-1; % qp=qp+1; % if Aptr==1,break;end % finished off the pairs % end % val=val*factorial(qp); % m(Aptr+1:Zptr,:)=[]; % end % Zptr=Aptr-1; % end % Zptr % % % reduce m of aa if ba or ca % N=size(m,1); % for i=N:-1:2 % if m(i,1)==m(i,2) % if any(sum(m==m(i,1))>1) % m(i,:)=[]; % end % end % end % % N=size(m,1); % for i=N:-1:1 % z{i}=m(i,:); % end % % % % Create blocks ab bc cd ef fg gh to abcd efgh or ad eh final m rows ! % mb=m*0; % % create strings adn then check if valid, ab ba is a 0 by abba or baab % % check_vint % while ~isequal(mb,m) % mb=m; % N=size(m,1); % iptr=N; % while iptr>1 % ptr=find(m(1:iptr-1,1)==m(iptr,2),1,'first'); % check end to starts % if ~isempty(ptr) % m(ptr,1)=m(iptr,1); % m(iptr,:)=[]; % z{ptr}=[z{iptr} z{ptr}]; % z(iptr)=[]; % else % checkstart to ends % ptr=find(m(1:iptr-1,2)==m(iptr,1),1,'first'); % check start to ends % if ~isempty(ptr) % start to end % m(ptr,2)=m(iptr,2); % m(iptr,:)=[]; % z{ptr}=[z{ptr} z{iptr}]; % z(iptr)=[]; % end % end % iptr=iptr-1; % end % while iptr % % end % mb m % % % for i=1:size(z,2) % [valid,vint]=check_vint(z{i}); % if ~valid % val=0; % return; % end % end % %m % % N=size(m,1); % % val=val*factorial(N); % % end % % function [valid,vint]=check_vint(v) % % create list of internal elements, may be empty set % % check if v is self consistent % % abbbc becomes abc; aabbcc abc % valid=0; % % dv=diff(v); % dv(dv==0)=[]; % remove dupes % vp=cumsum([v(1) dv]); % % if length(vp)>2 % vint=vp(2:end-1); % else % vint=[]; % end % % if length(vp)==length(unique(vp)) % valid=1; % end % % end % % % function [d] = read_file(fn) % % Output d{} string of strings separated by a space % d={}; % fid=fopen(fn); % fgetl(fid); % Total Count ignore % ptr=0; % while ~feof(fid) % fgetl(fid); % skip % ptr=ptr+1; % d{ptr}=fgetl(fid); % end % feof % fclose(fid); % % end % read_file