Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- title = input()
- n = int(input())
- for i in range(n):
- new_title = ''
- sub_title = input()
- #print(sub_title)
- for ch in title:
- if sub_title != '' and ch != sub_title[0]:
- new_title += ch
- else:
- new_title += '_'
- sub_title = sub_title[1:]
- if sub_title == '' and i == 0:
- indices = title.index(ch)
- new_title += title[indices+1:]
- our_string = ''
- for ch in new_title:
- if ch != '_':
- our_string += ch
- new_title = our_string
- title = new_title
- print(title)
- break
- elif sub_title == '' and i > 0:
- our_string = ''
- for ch in new_title:
- if ch != '_':
- our_string += ch
- new_title = our_string
- title = new_title
- print(title)
- break
- if title != '' and title[0] == new_title[0]:
- print('No such title found!')
Advertisement
Add Comment
Please, Sign In to add comment