Company: Amazon_11_feb
Difficulty: medium
DNA Sequencing Some data scientists are developing a tool to analyze palindromic trends in DNA sequences. The palindrome transformation cost of a string is defined as the minimum number of character changes required to rearrange it into a palindrome. For example, the palindrome transformation cost for the string "aabcd" is 1 because changing the last character 'd' to 'c' makes the string "aabcc", which can be rearranged into "acbca", a palindrome. A string can be rearranged into a palindrome if at most one character has an odd frequency count. The transformation cost is the minimum number of changes to satisfy this condition. This cost can be calculated as floor(k / 2) , where k is the number of characters with an odd frequency count in the string. Given a string dna , determine the total sum of palindrome transformation costs for all its substrings. Note: A palindrome is a sequence that reads the same backward as forward, such as "z", "aba", and "aaa". Sequences like "xy" and "rank" a