Longest Nice Substring

A nice substring contains every letter in both uppercase and lowercase. Find the longest nice substring; use bitmasks for lowercase and uppercase presence to test each candidate substring.

Examples
Input: "YazaAay"
Output: "aAa"
Hints

Longest Nice Substring

A nice substring contains every letter in both uppercase and lowercase. Find the longest nice substring; use bitmasks for lowercase and uppercase presence to test each candidate substring.