Cody

# Problem 541. Use of regexp

Solution 2148722

Submitted on 3 Mar 2020 by Ryo Ishido
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))

index = 15 37 54 68 ch = "I played piano." ch = 1×2 string array "I played piano." "John played football." ch = 1×3 string array "I played piano." "John played football." "Anita went home." ch = 1×4 string array "I played piano." "John played football." "Anita went home." "Are you safe?"

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))

index = 13 26 46 58 ch = "Are you okay?" ch = 1×2 string array "Are you okay?" "Who are you?" ch = 1×3 string array "Are you okay?" "Who are you?" "Olga will call you." ch = 1×4 string array "Are you okay?" "Who are you?" "Olga will call you." "Sam saw me."

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))

index = 12 23 36 45 61 ch = "One is more." ch = 1×2 string array "One is more." "Than what?" ch = 1×3 string array "One is more." "Than what?" "No it's not." ch = 1×4 string array "One is more." "Than what?" "No it's not." "But why?" ch = 1×5 string array "One is more." "Than what?" "No it's not." "But why?" "Angela said so."

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))

index = 13 22 44 56 ch = "One plus two." ch = 1×2 string array "One plus two." "Is four." ch = 1×3 string array "One plus two." "Is four." "No, that't not right." ch = 1×4 string array "One plus two." "Is four." "No, that't not right." "It's three."

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))

index = 12 28 40 53 67 ch = "I went home." ch = 1×2 string array "I went home." "After the game." ch = 1×3 string array "I went home." "After the game." "It was sad." ch = 1×4 string array "I went home." "After the game." "It was sad." "It was lame." ch = 1×5 string array "I went home." "After the game." "It was sad." "It was lame." "It was great!"

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))

index = 16 32 49 64 80 93 ch = "One, two, three." ch = 1×2 string array "One, two, three." "Climb the tree." ch = 1×3 string array "One, two, three." "Climb the tree." "Four, five, six." ch = 1×4 string array "One, two, three." "Climb the tree." "Four, five, six." "It's not here." ch = 1×5 string array "One, two, three." "Climb the tree." "Four, five, six." "It's not here." "Eight and nine." ch = 1×6 string array "One, two, three." "Climb the tree." "Four, five, six." "It's not here." "Eight and nine." "That's fine."

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

index = 19 24 44 ch = "Either one is fine." ch = 1×2 string array "Either one is fine." "Why?" ch = 1×3 string array "Either one is fine." "Why?" "Because he said so."