P9013 [USACO23JAN] Find and Replace S
Description
Bessie is using the latest and greatest innovation in text-editing software, miV! She starts with an input string consisting solely of upper and lowercase English letters and wishes to transform it into some output string. With just one keystroke, miV allows her to replace all occurrences of one English letter $c_1$ in the string with another English letter $c_2$. For example, given the string `aAbBa`, if Bessie selects $c_1$ as `a` and $c_2$ as `B`, the given string transforms into `BAbBB`.
Bessie is a busy cow, so for each of $T
(1 \le T \le 10)$ independent test cases, output the minimum number of keystrokes required to transform her input string into her desired output string.
Input Format
N/A
Output Format
N/A
Explanation/Hint
### Explanation for Sample 1
The first input string is the same as its output string, so no keystrokes are required.
The second input string cannot be changed into its output string because Bessie cannot change one `B`' to `A` while keeping the other as `B`.
The third input string can be changed into its output string by changing `a` to `b`.
The last input string can be changed into its output string like so: $\texttt{ABCD} \rightarrow \texttt{EBCD} \rightarrow \texttt{EACD} \rightarrow \texttt{BACD}$.
### Scoring
- Inputs $2-6$: Every string has a length at most $50$.
- Inputs $7-9$: All strings consist only of lowercase letters `a` through `e`
- Inputs $10-15$: No additional constraints.