← All problemsSign in

2742. Painting the Walls

LeetCodeArrayDynamic ProgrammingOpen on judge ↗

You are given two 0-indexed integer arrays, cost and time, of size n representing the costs and the time taken to paint n different walls respectively. There are two painters available: - A paid painter that paints the ith wall in time[i] units of time and takes cost[i] units of money. - A free painter that paints any wall in 1 unit of time at a cost of 0. But the free painter can only be used i

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start