I came across this question in a test. There are two parts to this question:

Part i:

Given a list of flavors, eg. ['A','A','A','A','B','B','B','B','B','C','C','C','C'], write a function that returns a dictionary of the number of each flavor respectively.

My solution:

```
flavors = ['A','A','A','A','B','B','B','B','B','C','C','C','C']

def count_flavors(l):
    dict_flavors={}
    for i in l:
        dict_flavors[i] = l.count(i)
    return dict_flavors

print(count_flavors(flavors))

```

Part ii:

Using not more than ONE for loop write a function that accepts a list of lists of flavors eg. [['A', 'A', 'B', 'B', 'B', 'C', 'C'], ['A', 'A', 'B', 'B', 'B', 'B', 'C'], ['A', 'B', 'C', 'C']] and returns a dictionary for the total number of each flavor. You must include the function that you defined in part one in this solution.
(To clarify, essentially there should only be two for loops; one from part one and one from part two)

So far my solution is the following:

```
batches = [['A','A','A','A','B','B','B','B','B','C','C','C','C'], ['A', 'A', 'B', 'B' ,'B','B','C'], ['A','B','C','C']]

def batch_count(b):
    batch_dict = []
    result = {}
    for j in b:
        batch_dict.append(count_flavors(j))
    print(batch_dict)
    for i in batch_dict:
        for k in i.keys():
            result[k] = result.get(k,0) + i[k]
    return result

print('batch count 1:' + str(batch_count(batches)))

```

I am struggling to find a solution that only uses one for loop for this part. I am aware that there are modules that exist for this sort of thing like `collections.Counter()`. Is a naive solution that does not include any modules possible for this problem?

Thanks!