Easy C++ Solution
Approach\n Describe your approach to solving the problem. \nCreating two auxilary Arrays and putting integers values of character by comparing.\nThen pushing st
# Approach\n<!-- Describe your approach to solving the problem. -->\nCreating two auxilary Arrays and putting integers values of character by comparing.\nThen pushing stored values in string and returning back the character from string.\n\n# Complexity\n- Time complexity:O(N)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity:O(N)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution {\npublic:\n    string greatestLetter(string s) {\n     vector<int>v1(26,0); //creating 2 auxilary vectors\n     vector<int>v2(26,0);\n     for(int i=0;i<s.size();i++){\n            if(s[i]-\'a\'>=0 &&  s[i]-\'a\'<=25){\n                v2[s[i]-\'a\']++;   //storing by comparing integers values to vectors. \n            }\n            else if(s[i]-\'A\'>=0 &&  s[i]-\'A\'<=25){\n                v1[s[i]-\'A\']++;\n            }\n        }\n        string k;\n        for(int i=25;i>=0;i--){\n            if(v1[i]>0 && v2[i]>0){\n                k.push_back(i+\'A\'); //pushing the character that is in both case.\n                break;\n            }\n        }\n        return k;\n    }\n};\n```
['String', 'C++']