multiply the total occurrences of first character before middle character with the total occurrences of third character after middle character
total = preLeft [ i - 1 ] * preRight [ i + 1 ] NEW_LINE counter += total NEW_LINE return counter NEW_LINE