Search
⌘K

Leetcode 2742. Painting the Walls

Pick a subset of walls for the paid painter to minimize total cost such that his total working time allows the free painter (who paints any wall in 1 time unit but only while the paid painter is busy) to finish the remaining walls. Equivalently, it's a 0/1 knapsack/DP: choosing wall i contributes weight time[i]+1 and you need total weight ≥ n at minimum cost.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.