Skip to content

Instantly share code, notes, and snippets.

@R4CHI7
Created March 10, 2018 06:00
Show Gist options
  • Save R4CHI7/91ff56dbdcdf3ba2bc96eb5cebec5ff4 to your computer and use it in GitHub Desktop.
Save R4CHI7/91ff56dbdcdf3ba2bc96eb5cebec5ff4 to your computer and use it in GitHub Desktop.
Split problem statement
cases = [
(' mte st m', ' ', ['', '', 'mte', '', 'st', 'm']),
('mtestm', ' ', ['mtestm']),
('mtestm', 'm', ['', 'test', '']),
('mmadfmm', 'm', ['', '', 'adf', '', '']),
('sfd 423', ' ', ['sfd', '', '', '423']),
('hello', ' ', ['hello']),
]
for i, (S, sep, expected_op) in enumerate(cases):
op = split(S, sep)
if op != expected_op:
print(i, S, sep, op, expected_op)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment