Problem 1542 · Hard

Find Longest Awesome Substring

Find the longest substring whose digits can be rearranged into a palindrome by tracking parity masks of digit counts. The visual highlights the best window and its mask states.

Open the interactive visualisation