SHARE
TWEET

Untitled

a guest Apr 21st, 2019 82 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. n = int(input())
  2. animals = [list(input().split()) for i in range(n)]
  3. k = 0
  4. max_k = 0
  5. all_chars = []
  6. for animal in animals:
  7.     animal = set(animal[2:])
  8.     all_chars.append(animal)
  9.  
  10. for i in range(n):
  11.     for j in range(n):
  12.         if i != j :
  13.             k = len(all_chars[i] & all_chars[j])
  14.             if k > max_k:
  15.                 max_k = k
  16.  
  17. print(max_k + 1)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top