Counter
Python 3\npython\nclass Solution:\n    def greatestLetter(self, s: str) -> str:\n        cnt = Counter(s)\n        return next((u for u in reversed(ascii_upperc
**Python 3**\n```python\nclass Solution:\n    def greatestLetter(self, s: str) -> str:\n        cnt = Counter(s)\n        return next((u for u in reversed(ascii_uppercase) if cnt[u] and cnt[u.lower()]), "")\n```\n**C++**\n```cpp\nstring greatestLetter(string s) {\n    int cnt[128] = {};\n    for (auto ch : s)\n        ++cnt[ch];\n    for (auto ch = \'Z\'; ch >= \'A\'; --ch)\n        if (cnt[ch] && cnt[ch + \'a\' - \'A\'])\n            return string(1, ch);\n    return "";\n}\n```
['C', 'Python3']