Advertisement
Guest User

Untitled

a guest
Oct 12th, 2016
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2. line = set(input())
  3. condition = 1
  4. setNew = set()
  5. while line != {'H', 'E', 'L', 'P'}:
  6. yesOrNo = input()
  7. if yesOrNo == 'YES' and condition == 1:
  8. setNew = line
  9. condition = 0
  10. elif yesOrNo == 'YES':
  11. setNew &= line
  12. else:
  13. setNew -= setNew & line
  14. line = set(input())
  15. print(' '.join(setNew))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement