Array
2106. Maximum Fruits Harvested After at Most K Steps
Fruits sit on a number line at fruits[i] = [pos, amount]. Start at startPos; each step moves ±1, at most k steps total; you collect fruit at every position visited. Maximise total collected. The…
Loading…