java O(n) solution
\nclass Solution {\n    public String greatestLetter(String s) {\n        char[] ca=s.toCharArray();\n        boolean[] lower = new boolean[26];\n        boolea
```\nclass Solution {\n    public String greatestLetter(String s) {\n        char[] ca=s.toCharArray();\n        boolean[] lower = new boolean[26];\n        boolean[] upper = new boolean[26];\n        for (char c:ca){\n            if (c>=\'a\' && c<=\'z\'){\n                lower[c-\'a\'] = true;\n            }\n            else {\n                upper[c-\'A\'] = true;\n            }\n        }\n        for (int i=25;i>=0;i--){\n            if (lower[i] && upper[i]){\n                return Character.toString((char)(\'A\'+i));\n            }\n        }\n        return "";\n    }\n}\n```
['Java']