Greatest English Letter in Upper and Lower Case LeetCode solution in Java
1class Solution {2public String greatestLetter(String s) {3Set<Character> set = new HashSet<>();4for (char ch : s.toCharArray()) set.add(ch);56for (char ch = 'Z'; ch >= 'A'; ch--)7if (set.contains(ch) && set.contains((char) ('a' + (ch - 'A')))) return "" + ch;8return "";9}10}