Problem 3713 · Medium

Longest Balanced Substring I

A substring is balanced when every distinct letter inside it appears the same number of times. Find the longest balanced substring.

Open the interactive visualisation