C++ Easy Using Unorderedmap
class Solution {\npublic:\n    string greatestLetter(string s) {\n        vectorv,v2;\n        string b;\n        unordered_mapm;\n      for(int i=0;i<s.size();
class Solution {\npublic:\n    string greatestLetter(string s) {\n        vector<char>v,v2;\n        string b;\n        unordered_map<char,int>m;\n      for(int i=0;i<s.size();i++){\n          if(isupper(s[i])) v.push_back(tolower(s[i])); \n          else m[s[i]]++;\n      }\n        sort(v.begin(),v.end(),greater<char>());\n        for(int i=0;i<v.size();i++){\n            if(m.find(v[i])!=m.end()) v2.push_back(toupper(v[i]));\n        }\n        for(int i=0;i<v2.size();i++){\n            if(v2[i]<=\'Z\' && v2[i]>=\'A\') b.push_back(v2[i]);\n            break;\n        }\n        return b;\n    }\n};
['String', 'C']