Two-dimensional Dynamic Programming
138 / 170Two-dimensional Dynamic ProgrammingLesson 3 of 11About 48 min
The second dimension is not a position. It is which situation you are currently in.
In a process where the step after releasing must be idle, why model just-released separately rather than merging it with free?
Read the constraints first and let them tell you what complexity is expected. Derive the approach, implement it, run the tests, and submit when it passes.