def calculateLetterScore(letter: str, word: str):
    """Calculate score for letter in given word. Score is defined as
    value of little-endian binary representation of word, where ones
    are letters for which score is calculated and rest is 0.\n
    For example: Given word 'tabaluga' and calculating score for letter
    'a'. Binary representation of such word will be '01010001' and its
    score will be 138.\n
    Scores are used to differentiate between words that have letters
    in same places and optimize calculating optimal guess based on amount
    of different 'layouts' available in given step."""
    score: int = 0
    for idx, word_letter in enumerate(word):
        if letter == word_letter:
            score = score + pow(2,idx)
    return score