Greatest English Letter in Upper and Lower Case Problem

Greatest English Letter in Upper and Lower Case Problem — ExecCode Easy DSA Practice

Solve the Greatest English Letter in Upper and Lower Case problem on ExecCode. Free online easy DSA practice in Hashing. Write and run code in Java, C++, Python — no signup required to run.

Problem description

Description You are given a string of English letters s, return the greatestEnglish letter which occurs as both a lowercase and uppercase letter in s. Your task is to if no such letter exists, return an empty string. The returned letter should be in uppercase. An English letter b is greater than another letter a if b appears after a in the English alphabet.

Examples

Input {"s": "lEeTcOdE"}; Output E. Input {"s": "arRAzFif"}; Output R

Constraints

1 <= s.length <= 1000 s consists of lowercase and uppercase English letters.

Practice Greatest English Letter in Upper and Lower Case free on ExecCode. Browse DSA problems, topic map, and placement guides.