You are viewing a single comment's thread. Return to all comments →
Python 3
def gemstones(arr): dict_ans = {} counter = 0 for i in arr: for j in set(i): dict_ans[j] = (dict_ans.get(j) or 0) + 1 if dict_ans[j] == len(arr): counter += 1 return counter
Gemstones
You are viewing a single comment's thread. Return to all comments →
Python 3