Search⌘ K
AI Features

Fruit Into Baskets

Fruit Into Baskets gives a row of fruit types and two unlimited baskets. Find the longest contiguous run you can collect while carrying at most two fruit types.

Statement

While visiting a farm of fruits, you have been given a row of fruits represented by an integer array, fruits, where ...