Java Solution easy way general formula
\nclass Solution {\n    public String greatestLetter(String s) {\n        List<Character> list = new ArrayList<>();\n        for (char c : s.toCharArray()){\n  
```\nclass Solution {\n    public String greatestLetter(String s) {\n        List<Character> list = new ArrayList<>();\n        for (char c : s.toCharArray()){\n            if (c >= 65 && c <= 90){\n                list.add(c);\n            }\n        }\n        Collections.sort(list);\n        Collections.reverse(list);\n        for (char c : list){\n            for (int i = 0; i < s.length(); i++){\n                if (c == s.charAt(i)) continue;\n                if (c == (s.charAt(i) - 32)) return String.valueOf(c);\n            }\n        }\n        return "";   \n    }\n}\n```
['Array', 'Java']