Find the longest contiguous subarray containing at most two distinct fruit types.
Constraints
Example
>>> totalFruit([1,2,1]) 3 >>> totalFruit([0,1,2,2]) 3 >>> totalFruit([1,2,3,2,2]) 4
Recent Submissions
No submissions yet — hit Run Tests to try!
Hints