Java O(N) solution
\npublic String greatestLetter(String s) {\n        int[] up = new int[26];\n        int[] low = new int[26];\n        String ans="";\n        for(int i=0;i<s.l
```\npublic String greatestLetter(String s) {\n        int[] up = new int[26];\n        int[] low = new int[26];\n        String ans="";\n        for(int i=0;i<s.length();i++){\n            if(s.charAt(i)>=\'A\' && s.charAt(i)<=\'Z\'){\n                up[s.charAt(i)-\'A\']=1;\n            }else{\n                low[s.charAt(i)-\'a\']=1;\n            }\n        }\n        for(int i=25;i>=0;i--){\n            if(up[i]>0 && low[i]>0){\n                ans += (char)(i+\'A\');\n                break;\n            }\n        }\n        return ans;\n    }\n```
['Java']