Our score function is inefficient due to repeated calls for the same suffixes. Lets make a dictionary to remember previous results. We will use the Tree of tuples and insert/c