John Deere Interview Question

A hard level leetcode DP problem, something like coin change but more complicated