Company: Intuit_17_jan
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 be able to rearrange it into a palindrome. For a string to be rearrangeable into a palindrome, it must have at most one character with an odd frequency count. The cost is the minimum number of changes to satisfy this condition. For example, if a string has character counts where 4 characters appear an odd number of times, we can change one of these characters to another, reducing the number of odd-count characters by two. Thus, the cost is floor(number_of_characters_with_odd_counts / 2) . 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" are not palindromes. Function Description Compl