Question: Xavier needs to defuse N bombs from 1 to N . Every ith bomb is gonna explode in Y _ { 1 } seconds. He
Xavier needs to defuse N bombs from to N
Every ith bomb is gonna explode in Y seconds. He takes Xi seconds to defuse th bomb and he must defuse this bomb before or at this time to survive.He can only defuse one bomb at a time.
Xavier having this information beforehand has reached out to you for your help. Rescue Xavier to let him know if it is safe for him to defuse all the bombs. If he can, return minimum time by which all the bombs can be defused; if he cannot, return
Example:
N:
bombinfo:
Give code for these constraints
input integer n
N
input array.array.integer bombinfo
bombinfo is a given D array of N Rows and columns
Xi represents time taken by Xavier to defuse i
th bomb Yi represents time by which ith bomb will explode
Xi Yi iN
output integer
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
