Java repeated letter check in string
问题 I'm having problem figuring out how to check from users input letters that were repeated. Program needs to output repeated letter as true and if there isn't any then as false. Program should not count numbers or symbols as repeated. For example: User input: Chocolate Program Output: True User input: 112 cream Program Output: False 回答1: Here is another version, based on answer from @rell but with no HashSet or char[] creation. private static boolean check(String input) { for (int i = 0; i <