s is nice if, for every letter of the alphabet that
s contains, it appears both in uppercase and lowercase. For example,
"abABB" is nice because
'a' appear, and
'b' appear. However,
"abA" is not because
'b' appears, but
'B' does not.
Given a string
s, return the longest substring of
s that is nice. If there are multiple, return the substring of the earliest occurrence. If there are none, return an empty string.
Input: s = "YazaAay" Output: "aAa" Explanation: "aAa" is a nice string because 'A/a' is the only letter of the alphabet in s, and both 'A' and 'a' appear. "aAa" is the longest nice substring.
Input: s = "Bb" Output: "Bb" Explanation: "Bb" is a nice string because both 'B' and 'b' appear. The whole string is a substring.
Input: s = "c" Output: "" Explanation: There are no nice substrings.
Input: s = "dDzeE" Output: "dD" Explanation: Both "dD" and "eE" are the longest nice substrings. As there are multiple longest nice substrings, return "dD" since it occurs earlier.
1 <= s.length <= 100
sconsists of uppercase and lowercase English letters.