Given three arrays of integers, return the sum of elements that are common in all three arrays.

For example: 

```
common([1,2,3],[5,3,2],[7,3,2]) = 5 because 2 & 3 are common in all 3 arrays
common([1,2,2,3],[5,3,2,2],[7,3,2,2]) = 7 because 2,2 & 3 are common in the 3 arrays
```

More examples in the test cases. 

Good luck!

Source: codewars | Difficulty: EASY
Tags: Data structures

Starter code: def common(a,b,c):
	

Solutions:
from collections import Counter

def common(a, b, c):
	return sum((Counter(a) & Counter(b) & Counter(c)).elements())


from functools import reduce
from operator import and_
from collections import Counter

def common(a, b, c):
	return sum(reduce(and_, map(Counter, (a, b, c))).elements())


from collections import Counter
from functools import reduce
from operator import and_

def common(*args):
	return sum((key * value for (key, value) in reduce(and_, map(Counter, args)).items()))


from collections import Counter

def common(a, b, c):
	abc = Counter(a) & Counter(b) & Counter(c)
	return sum((n * q for (n, q) in abc.items()))


from collections import Counter
from operator import mul, and_
from itertools import starmap
from functools import reduce

def common(*args):
	return sum(starmap(mul, reduce(and_, map(Counter, args)).items()))


def common(a, b, c):
	a.sort()
	b.sort()
	c.sort()
	i = j = k = c1 = 0
	while i < len(a) and j < len(b) and (k < len(c)):
		if a[i] == b[j] == c[k]:
			c1 += a[i]
			i += 1
			j += 1
			k += 1
		elif a[i] < b[j]:
			i += 1
		elif b[j] < c[k]:
			j += 1
		else:
			k += 1
	return c1


def common(a, b, c):
	d = set(a) & set(b) & set(c)
	a = [i for i in a if i in d]
	b = [i for i in b if i in d]
	c = [i for i in c if i in d]
	return sum([i * min(a.count(i), b.count(i), c.count(i)) for i in d])


common = lambda *a, c=__import__('collections').Counter: sum(__import__('functools').reduce(c.__and__, map(c, a)).elements())


from collections import Counter

def common(a, b, c):
	(counts_a, counts_b, counts_c) = (Counter(a), Counter(b), Counter(c))
	sum = 0
	for n in set(counts_a.keys()) & set(counts_b.keys()) & set(counts_c.keys()):
		sum += n * min([counts_a[n], counts_b[n], counts_c[n]])
	return sum