Simple sol | c++
\nclass Solution {\npublic:\n    string greatestLetter(string s) {\n        int n = s.size();\n        \n        unordered_map<char , int> mp;\n        \n      
```\nclass Solution {\npublic:\n    string greatestLetter(string s) {\n        int n = s.size();\n        \n        unordered_map<char , int> mp;\n        \n        string res = "!";\n        char ch = \'!\';\n        \n        for(int i=0;i<n;i++){\n            if(s[i] >= \'a\' && s[i] <= \'z\') mp[s[i]]++;\n            else{\n                if(mp[s[i] + 32] > 0 && s[i] > ch){\n                    \n                      ch = s[i] ;\n                      res.pop_back();\n                      res += s[i];\n                }\n            }\n        }\n        \n        \n        if(ch == \'!\') return "";\n        return res;\n    }\n};\n```
[]