Given an array of integers `fruit_types` representing the types of fruits, determine the maximum number of fruits that can be harvested under the constraint that only fruits of the same type can be picked consecutively.
Explanation: The maximum number of fruits that can be harvested consecutively is 3, which are of type 3.
Explanation: All 5 fruits are of the same type and can be harvested consecutively.
Analyze constraints and compute optimal solutions step-by-step.
No dry run loaded.
🚀 Practice this problem
Run code, get AI hints & track streak