You are viewing a single comment's thread. Return to all comments →
Why should we use regex? Why should we use more than one line on Python? Ok, I'm just kiddin', never do like this:
[print((0 if s.endswith(h) else 1) if s.startswith(h) else (2 if s.endswith(h) else -1 )) for s, h in ((input(), 'hackerrank') for _ in range(int(input())))]
Find HackerRank
You are viewing a single comment's thread. Return to all comments →
Why should we use regex? Why should we use more than one line on Python? Ok, I'm just kiddin', never do like this: