✅C++ | ✅Easy Hashmap solution O(N)
\nclass Solution {\npublic:\n    string greatestLetter(string s) {\n        //store string in a hashmap for easy finding\n        unordered_map<char, int> mpp;\
```\nclass Solution {\npublic:\n    string greatestLetter(string s) {\n        //store string in a hashmap for easy finding\n        unordered_map<char, int> mpp;\n        for(auto it: s){\n            mpp[it]++;\n        }\n        \n        sort(s.begin(), s.end());   //because we want greater value at the end\n        string str = "";\n        for(int i=0; i<s.size(); i++){\n            \n            char l = tolower(s[i]);\n            char u = toupper(s[i]);\n            // cout<<l<<" "<<u<<endl;\n            \n            if(mpp[l] && mpp[u]){   //if we have both lower and upper case for a letter\n                str = u;\n            }     \n        }\n        \n        return str;\n    }\n};\n```\n\n**Please do upvote if you like the solution:)**
['C']