Problem 904 · Medium

Fruit Into Baskets

Each position holds a fruit type, and the goal is the longest run of positions that uses at most two types. The visual slides a window across tiles while a small counter tracks the types inside.

Open the interactive visualisation