Given a DNA string dna, calculate the combined cost of converting every substring into a palindrome.
For an individual substring:
Return the sum of these costs for all substrings as a long value.
A suitable function signature is:
long totalPalindromeConversionCost(String dna)
Input: dna = "ACG"
Output: 3
The length-two substrings each contribute 1, and the full substring contributes 1; all one-character substrings contribute 0.
Input: dna = "AAA"
Output: 0
Every mirrored pair already matches in every substring.
Input: dna = ""
Output: 0
An empty string contains no substrings with mismatched mirrored pairs.
long, for the returned total because the number of substrings is quadratic in the string length and the accumulated cost may become large.