✅C++ || ✅Using set || ✅ Simple String Solution || ✅Short & Easy
\nclass Solution {\npublic:\n    string greatestLetter(string s) \n    {    \n        unordered_set<char>lower;\n        unordered_set<char>upper;\n        \n  
```\nclass Solution {\npublic:\n    string greatestLetter(string s) \n    {    \n        unordered_set<char>lower;\n        unordered_set<char>upper;\n        \n        for(int i=0;i<s.length();i++)\n        {\n            if(s[i]>=\'a\' and s[i]<=\'z\')\n            {\n                lower.insert(s[i]);\n            }\n            else if(s[i]>=\'A\' and s[i]<=\'Z\')\n            {\n                upper.insert(s[i]);\n            }\n        }\n        char ch=\'@\';\n        for(int i=0;i<s.length();i++)\n        {\n            char small = tolower(s[i]);\n            char big = toupper(small);\n            \n            if(lower.find(small)!=lower.end() and upper.find(big)!=upper.end())\n            {\n               if(ch==\'@\')\n               {\n                   ch=big;                   \n               }\n               else if(ch != \'@\' and big > ch)\n               {\n                   ch=big;\n               }\n            }\n        }\n        if(ch==\'@\')\n            return "";\n        \n        string str="";\n        str.push_back(ch);\n        return str;\n    }\n};\n```
['C', 'C++']