1D Arrays | Linear Time | C + +
Time Complexity : O(n)\nSpace Complexity : O(n)\n\n vector<int> v1(26,0),v2(26,0);\n        \n        \n           for(int i =0;i<s.size();i++){\n              
Time Complexity : O(n)\nSpace Complexity : O(n)\n```\n vector<int> v1(26,0),v2(26,0);\n        \n        \n           for(int i =0;i<s.size();i++){\n               \n               if(s[i]-\'A\'>=0 && s[i]-\'A\'<26){\n                   v2[s[i]-\'A\']++;\n               }\n               else{\n                 v1[s[i]-\'a\']++;\n               }\n               \n           }\n        \n        string ans ="";\n        \n        for(int i=25;i>=0;i--){\n            if(v1[i]!=0 && v2[i]!=0){\n                ans+= i+\'A\';\n                return ans;\n            }\n        }\n        \n        return ans;\n        \n```
[]