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)]
```
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
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