java solution | fast 2 ms 87 % | simple
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\n     public static String greatestLetter(String s) {\n\n        int[] up = new int[26];\n        int[] lo = new int[26];\n\n        for (char x : s.toCharArray()) {\n            if (\'z\' - x < 26) {\n                lo[\'z\' - x] = 1;\n            } else up[\'Z\' - x] = 1;\n        }\n\n        for (int i = 0; i < 26; i++) {\n            if (up[i] != 0 && up[i] == lo[i]) {\n                return String.valueOf((char) (\'Z\' - i));\n            }\n        }\n        return "";\n    }\n}\n```
['Array', 'Math', 'String', 'Java']