def counterFrequency(text):
    """Obtain the most frequent item from a given string TEXT
    
    Keyword arguments:
    text -- the word

    As the fuction contains a loop where it iterates within a text on n lenght the resulting complexity would be
    O(n) or linear as the operations performed with the dictionary are O(1) or constant 
    """
    dictText = {}
    maxN = 0
    mostFrequent = ""
    for item in text:
        if (item not in dictText):
            dictText[item] = 1
        else: 
            dictText[item] +=1
        
        if (dictText[item] > maxN):
            mostFrequent = item
            maxN = dictText[item]
    return mostFrequent