Fruit Into Baskets
Input:
[1,2,1]
Output:
3
Explanation:
We can collect [1,2,1].Input:
[0,1,2,2]
Output:
3
Explanation:
We can collect [1,2,2].
If we started at the first tree, we would only collect [0, 1].Analysis
Solution
Reference
Last updated