Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- title = list(input())
- n = int(input())
- for _ in range(n):
- word = input()
- current_title = title.copy()
- word_found = True
- for letter in word:
- if letter in current_title:
- current_title.remove(letter)
- else:
- word_found = False
- break
- if word_found:
- print(''.join(current_title))
- title = current_title
- else:
- print("No such title found!")
Advertisement
Add Comment
Please, Sign In to add comment