← All problemsSign in

3771. Total Score of Dungeon Runs

LeetCodeArrayBinary SearchPrefix SumOpen on judge ↗

You are given a positive integer hp and two positive 1-indexed integer arrays damage and requirement. There is a dungeon with n trap rooms numbered from 1 to n. Entering room i reduces your health points by damage[i]. After that reduction, if your remaining health points are at least requirement[i], you earn 1 point for that room. Let score(j) be the number of points you get if you start with hp

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