Solution
input_text = "aabcc"
result = 0
hmap = {"aa": 2, "ba": 1, "bb": 2, "cb": 1, "ac": 1, "cc": 2, "b": 1, "c": 2}
for i in range(len(input_text)):
if i == 0:
result += hmap.get(input_text[i], 0)
else:
result += hmap.get(input_text[i-1]+input_text[i], 0)
return result