Problem · Greedy
Find Minimum Time to Defuse All Bombs (For off-campus 2025 batch hiring :)
Learn this problemProblem statement
Another question about defusing bombs - uber-defuse-the-bombs
There are N bombs in a row, each bomb 💣, say i (0 <= i < N) has a detonation time of xi and time to defuse it is yi. Find the minimum time to defuse all the bombs if possible, otherwise -1.
The first line of input is the number of bombs N. The second line consists of N space separated values denoting the time to defuse the bombs. The third line consists of N space separated values denoting the time for detonation of bombs.
Function
findMinimumTimeToDefuseAllBombs(defuseTime: int[], detonationTime: int[]) → intExamples
Example 1
defuseTime = [2, 1, 3, 1]detonationTime = [4, 9, 8, 2]return = 7🐻❄️