O(n) Greatest English Letter in Upper and Lower Case Solution in C++
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity:\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\nO(n)\n- Space complexity:\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\nO(n)\n# Code\n```\nclass Solution {\npublic:\n    string greatestLetter(string s) {\n        vector<int> lower(26, 0);\n        vector<int> upper(26, 0);\n        int i;\n        string ans;\n        for(i=0 ; i<s.length() ; i++)\n        {\n            if(s[i]>=97)\n                lower[s[i]-97] = 1;\n            else\n                upper[s[i]-65] = 1;\n        }\n        for(i=25 ; i>=0 ; i--)\n        {\n            if(lower[i]==1 && upper[i]==1)\n            {\n                ans = i+65;\n                break;\n            }\n        }\n        return ans;\n    }\n};\n```\n![upvote new.jpg](https://assets.leetcode.com/users/images/df8c1934-50f0-4fc2-85b8-889a8a0cf108_1685508461.737817.jpeg)\n
['C++']