← All problemsSign in

Maximize Room Pressure

​ In a row n connected rooms  there are k gas cylinder: the **i-th** gas cylinder is placed in room ri (1≤ri≤n). Two or more gas cylinder cannot be placed in the same room \. Each gas cylinder  generate pressure in **i-th** room is pi \. We can calculate pressure of every room $ 1\leq i\leq n$ using following formula **Max(pi -| ri −i |)** where  $1\leq j\leq k$ .|x-y| denote the absolute diffe

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