import functools
import operator
from typing import Counter


def get_counter(list_of_symptoms: list) -> list:
    """Generates a counter of words with its number of occurences

    Args:
        list_of_symptoms (list): A list of set of symptoms -> [{...},{...},{..},..]

    Returns:
        Counter object: counter object with word and its occurence number
    """
    counter = functools.reduce(
        operator.add,
        (
        Counter(set(symptoms)) for symptoms in list_of_symptoms
        )
    )
    return counter