Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- title = input()
- N = int(input())
- L = []
- Del = []
- for i in range(N):
- L.append(input())
- for word in L:
- check = False
- place = 0
- Del = []
- for letter in word:
- if title.find(letter, place) >= 0:
- place = title.find(letter, place)
- Del.append(place)
- place += 1
- else:
- break
- else:
- check = True
- if check:
- new_title = list(title)
- for j in range(len(Del) - 1, -1, -1):
- new_title.pop(Del[j])
- title = ''
- for i in new_title:
- title += i
- print(title)
- else:
- print("No such title found!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement