int charToInt(String char) { char = char.toLowerCase(); return char.codeUnitAt(0) - 'a'.codeUnitAt(0) + 1; }