Cody

# Problem 541. Use of regexp

Solution 1216916

Submitted on 20 Jun 2017 by Augusto Mazzei
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
x = 'I played piano. John played football. Anita went home. Are you safe?'; y = {'I played piano.' 'Anita went home.' 'Are you safe?'}; assert(isequal(lazy(x),y))

e = 15 37 54 68 e = 21 38 52 e = 16 30 e = 13

2   Pass
x = 'Are you okay? Who are you? Olga will call you. Sam saw me.'; y = {'Olga will call you.'}; assert(isequal(lazy(x),y))

e = 13 26 46 58 e = 12 32 44 e = 19 31 e = 11

3   Pass
x = 'One is more. Than what? No it''s not. But why? Angela said so.'; y = {'One is more.' 'Angela said so.'}; assert(isequal(lazy(x),y))

e = 12 23 36 45 61 e = 10 23 32 48 e = 12 21 37 e = 8 24 e = 15

4   Pass
x = 'One plus two. Is four. No, that''t not right. It''s three.'; y = {'One plus two.' 'It''s three.'}; assert(isequal(lazy(x),y))

e = 13 22 44 56 e = 8 30 42 e = 21 33 e = 11

5   Pass
x = 'I went home. After the game. It was sad. It was lame. It was great!'; y = {'I went home.' 'After the game.' 'It was lame.'}; assert(isequal(lazy(x),y))

e = 12 28 40 53 67 e = 15 27 40 54 e = 11 24 38 e = 12 26 e = 13

6   Pass
x = 'One, two, three. Climb the tree. Four, five, six. It''s not here. Eight and nine. That''s fine.'; y = {'One, two, three.' 'It''s not here.' 'Eight and nine.'}; assert(isequal(lazy(x),y))

e = 16 32 49 64 80 93 e = 15 32 47 63 76 e = 16 31 47 60 e = 14 30 43 e = 15 28 e = 12

7   Pass
x = 'Either one is fine. Why? Because he said so.'; y = {'Either one is fine.'}; assert(isequal(lazy(x),y))

e = 19 24 44 e = 4 24 e = 19