Simple Java Solution with O(n) time & O(1) space
\nclass Solution {\n    public String greatestLetter(String s) \n    {\n        char ch= \'z\' , CH = \'Z\';\n        \n        for(int i=0; i<26;i++)\n        
```\nclass Solution {\n    public String greatestLetter(String s) \n    {\n        char ch= \'z\' , CH = \'Z\';\n        \n        for(int i=0; i<26;i++)\n        {            \n            if(s.indexOf(ch) != -1 && s.indexOf(CH) != -1)\n                return "" + CH;\n            \n            else\n            {\n                ch--;\n                CH--;\n            }\n        }\n        return "";\n    }\n}\n```
['String', 'Java']