Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- words_pairs = [
- ['gameftgh', 'game'],
- ['forgameng', 'forge'],
- ['gaming', 'gaming']
- ]
- def exercise(case: str, checker: str) -> bool:
- for check in checker:
- if check in case:
- case = case.replace(check, '', 1)
- else:
- return 'NO'
- if case:
- return 'YES'
- else:
- return 'NO'
- for pair in words_pairs:
- print(pair)
- print(exercise(pair[0], pair[1]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement