summaryrefslogtreecommitdiff
path: root/progs/a108.py
blob: 25313062cee33c109b79ed76e361c9987583c62a (plain)
1
2
3
4
5
6
7
8
9
10
from collections import defaultdict 
def get_unique(test_list):
  res = defaultdict(list)
  for sub in test_list:
    res[sub[1]].append(sub[0])
  res = dict(res)
  res_dict = dict()
  for key in res:
    res_dict[key] = len(list(set(res[key])))
  return (str(res_dict))