Java | HashSet
\nclass Solution\n{\n    public String greatestLetter(String s)\n    {\n        Set<Character> set = new HashSet<>();\n        for(char ch : s.toCharArray())\n 
```\nclass Solution\n{\n    public String greatestLetter(String s)\n    {\n        Set<Character> set = new HashSet<>();\n        for(char ch : s.toCharArray())\n            set.add(ch);\n        \n        for(char ch = \'Z\'; ch >= \'A\'; ch--)\n            if(set.contains(ch) && set.contains((char)(\'a\'+(ch-\'A\'))))\n               return ""+ch;\n        return "";\n    }\n}\n```
['Java']