Problem 2516 · Medium

Take K of Each Character From Left and Right

Keep the longest middle window that can be removed while every letter still has at least k left at the ends.

Open the interactive visualisation