There are only \(26\) possible consistent strings which \(S\) might be changed into, with all characters in \(S\) ending up equal to some character \(x\) (`"A"` \(\le x \le\) `"Z"`). We'll consider each possible value of \(x\) and compute the total number of seconds required to change all characters in \(S\) into \(x\), with the minimum of those \(26\) possible totals being our final answer. For each character \(x\), we'll need to consider each character \(c\) in \(S\) and compute the number of seconds required to change \(c\) into \(x\). If \(c = x\), then \(0\) seconds are required. If \(c\) is a vowel while \(x\) is a consonant (or vice versa), then \(1\) second is required. Otherwise (that is, \(c\) and \(x\) differ but are either both vowels or both consonants), \(2\) seconds are required. [See David Harmeyer's solution video here](https://youtu.be/p5yPTHNUTlc).