## Editorial for An Animal Contest 2 P1 - Koala Konundrum

Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.

Submitting an official solution before solving the problem yourself is a bannable offence.

Author: WilliamWu277

Let us define an odd letter as a letter with an odd number of occurrences and an even letter as a letter with an even number of occurrences. We record the number of times that each letter appears in , and determine the number of odd and even letters.

A key observation is that we can combine all even letters into a single palindrome. For example, if the letters a and b occur twice, they can form a single palindrome of the form abba. Thus, is simply , as we have a minimum of one palindrome.

Time Complexity: