Ezvor

3466. Maximum Coin Collection

MediumArray Preparing judge… LeetCode
ArrayDynamic Programming

Hints

Hint 1
Can we use dynamic programming?
Hint 2
Use dynamic programming with states: dp[i][lane][rem] = the maximum number of coins you can obtain when you are at mile i in the given lane with rem switches remaining.