Advertisement
Bad_Programist

Untitled

Mar 10th, 2019
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.44 KB | None | 0 0
  1. n = int(input())
  2. stress = {}
  3.  
  4. for i in range(n):
  5.     word = input()
  6.     lower_word = word.lower()
  7.     if lower_word not in stress:
  8.         stress[lower_word] = set()
  9.     stress[lower_word].add(word)
  10.  
  11. text = input().split()
  12. error = 0
  13. for word in text:
  14.     lower_word = word.lower()
  15.     if lower_word in stress and word not in stress[lower_word] or \
  16.             sum(map(str.isupper, word)) != 1:
  17.         error += 1
  18.  
  19. print(error)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement