Implement a function which behaves like the 'uniq -c' command in UNIX. 

It takes as input a sequence and returns a sequence in which all duplicate elements following each other have been reduced to one instance together with the number of times a duplicate elements occurred in the original array.

Example:

```python
['a','a','b','b','c','a','b','c'] --> [('a',2),('b',2),('c',1),('a',1),('b',1),('c',1)]
```

Difficulty: EASY
Starter code: def uniq_c(seq):
	

Solutions:
from itertools import groupby

def uniq_c(seq):
	return [(k, sum((1 for _ in g))) for (k, g) in groupby(seq)]


def uniq_c(s):
	lst = []
	c = 1
	for i in range(len(s) - 1):
		if s[i] != s[i + 1]:
			lst.append((s[i], c))
			c = 1
		else:
			c += 1
	if s:
		lst.append((s[-1], c))
	return lst


from itertools import groupby

def uniq_c(seq):
	return [(chr, len(list(n))) for (chr, n) in groupby(seq)]


from itertools import groupby

def uniq_c(seq):
	ans = []
	for (c, e) in groupby(seq):
		l = list(e)
		ans.append((c, len(l)))
	return ans


uniq_c = lambda l: (lambda x: [(x[i][1], x[i][0] - x[i - 1][0]) if i > 0 else (x[0][1], x[0][0] + 1) for i in range(len(x))])((lambda t: [(t[i][0], t[i][1]) for i in range(len(t) - 1) if t[i][1] != t[i + 1][1]])(list(enumerate(l))) + [(len(l) - 1, l[-1])]) if l != [] else []


def uniq_c(seq):
	if not seq:
		return []
	res = []
	cur = seq[0]
	counter = 1
	for c in seq[1:]:
		if c == cur:
			counter += 1
		else:
			res.append((cur, counter))
			cur = c
			counter = 1
	res.append((cur, counter))
	return res


def uniq_c(seq):
	m = []
	(n, i) = (len(seq), 0)
	while i < n:
		c = seq[i]
		j = i + 1
		while j < n and seq[j] == c:
			j += 1
		m.append((c, j - i))
		i = j
	return m


def uniq_c(seq):
	(stack, out) = ([], [])
	for x in seq:
		if stack and x == stack[-1]:
			stack.append(x)
		elif stack:
			out.append((stack[-1], len(stack)))
			stack.clear()
			stack.append(x)
		else:
			stack.append(x)
	return stack and out + [(stack[-1], len(stack))] or out


def uniq_c(seq):
	seq.append('asdadasd')
	arr = []
	count = 1
	for i in range(len(seq) - 1):
		if seq[i] == seq[i + 1]:
			count += 1
		else:
			arr.append((seq[i], count))
			count = 1
	return arr


def uniq_c(seq):
	new_seq = list()
	count = 0
	for i in range(len(seq)):
		if i == 0:
			new_seq.append(seq[i])
			count += 1
			continue
		if seq[i] == seq[i - 1]:
			count += 1
		else:
			new_seq[-1] = (seq[i - 1], count)
			count = 1
			new_seq.append(seq[i])
	if len(seq) != 0:
		new_seq[-1] = (seq[-1], count)
	return new_seq