Advertisement
CR7CR7

searchT

Mar 28th, 2023
1,042
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. title_str = input()
  2. for _ in range(int(input())):
  3.     substring = input()
  4.     new_word = ''
  5.     for char in title_str:
  6.         if substring != '' and char == substring[0]:
  7.             substring = substring[1:]
  8.         else:
  9.             new_word += char
  10.     if substring == '':
  11.         title_str = new_word
  12.         print(title_str)
  13.     else:
  14.         print("No such title found!")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement