@Marco13 The
char
type, as I said, really is flawed and obsolete. Working with code point integers is the correct way to handle characters in modern Java. I wrote this code using arrays rather than collections to keep the code simple and close to the code as seen in the Question. Teaching new programmers to expect only American English and ASCII text is irresponsible in the modern world of information systems. I wrote exactly the Answer I would have wanted to find if I were new to programming and writing that Question. —
Basil Bourque 21 secs ago