Boolean[]
Code\n\nclass Solution {\n    public String greatestLetter(String s) {\n        String ans = "";\n        \n        boolean[] upper = new boolean[26];\n        
# Code\n```\nclass Solution {\n    public String greatestLetter(String s) {\n        String ans = "";\n        \n        boolean[] upper = new boolean[26];\n        boolean[] lower = new boolean[26];\n\n        for(char ch : s.toCharArray()){\n\n            if(Character.isUpperCase(ch)){\n                upper[ch - \'A\'] = true;\n            }else{\n                lower[ch - \'a\'] = true;               \n            }\n\n        }\n\n        for(int i = 25; i >= 0; i--){\n\n            if(upper[i] && lower[i]){\n\n                ans = String.valueOf((char)(i + \'A\'));\n                break;\n            }\n\n        }\n\n        return ans;\n\n    }\n}\n```
['Hash Table', 'Java']