2
public char repeatedCharacter(String s) {3
HashSet<Character> set = new HashSet<>(); // Create a set of characters4
for (int i = 0; i < s.length(); i++) {5
if (set.contains(s.charAt(i)))7
i); // If the set already contains the current character, then it is the required ans10
return 'a'; // As it is given in the question that there is at least one letter that appears11
// twice, therefore it is certain that the ans will be found before we reach this12
// statement. So, just adding any random return statement so that there is no error