Sponsored
Sponsored
Use these hints if you're stuck. Try solving on your own first.
Count frequency of each character in the string.
Use dynamic programming.
The states are the characters, sum of even index numbers, and the number of digits used.
Calculate the sum of odd index numbers without using a state for it.