C++ || 0 ms || O(n) Time and Space || With Explanation
\nclass Solution {\npublic:\n    string greatestLetter(string s) {\n        vector<int> letters(26, 0);\n        int size = s.size();\n        /* \n            
```\nclass Solution {\npublic:\n    string greatestLetter(string s) {\n        vector<int> letters(26, 0);\n        int size = s.size();\n        /* \n            Initially letters will contain 0\'s as none of the letters are visited.\n            The values of letters will range from 0 to 3,\n            0 => not visited\n            1 => uppercase visited\n            2 => lowercase visited\n            3 => both lowercase and uppercase visited\n        */\n        \n        for(int i = 0; i < size; i++){\n            if(s[i] <= \'Z\'){                        // if letter is in uppercase\n                if(letters[s[i] - \'A\'] == 0)\n                    letters[s[i] - \'A\'] = 1;\n                else if(letters[s[i] - \'A\'] == 2)\n                    letters[s[i] - \'A\'] = 3;\n            }\n            else{                                     // if letter is in lowercase\n                if(letters[s[i] - \'a\'] == 0)\n                    letters[s[i] - \'a\'] = 2;\n                else if(letters[s[i] - \'a\'] == 1)\n                    letters[s[i] - \'a\'] = 3;\n            }\n        }\n        \n        // Now to find the required character\n        \n        string res = "";\n        \n        for(int i = 25; i >= 0; i--){\n            if(letters[i] == 3){\n                res += char(\'A\'+i);\n                break;\n            }\n        }\n        \n        return res;\n    }\n};\n```\n\nPlease upvote if you like the solution... ;)
['String', 'C', 'C++']