you give 0indexed 2D integer array tires tiresi fi ri indicate ith tire finish xth successive lap fi rix1 secondsFor example fi 3 ri 2 tire finish 1st lap 3 second 2nd lap 3 2 6 second 3rd lap 3 22 12 second etcyou give integ changetime integer numLapsThe race consist numlap lap start race tire you unlimited supply tire lap change give tire include current tire type wait changeTime secondsReturn minimum time finish race Example 1input tire 2334 changetime 5 numlap 4Output 21explanation Lap 1 Start tire 0 finish lap 2 secondsLap 2 continue tire 0 finish lap 2 3 6 secondslap 3 Change tire new tire 0 5 second finish lap 2 secondsLap 4 continue tire 0 finish lap 2 3 6 secondstotal time 2 6 5 2 6 21 secondsthe minimum time complete race 21 secondsexample 2input tire 1102234 changeTime 6 numlap 5output 25explanation Lap 1 Start tire 1 finish lap 2 secondsLap 2 continue tire 1 finish lap 2 2 4 secondsLap 3 Change tire new tire 1 6 second finish lap 2 secondsLap 4 continue tire 1 finish lap 2 2 4 secondslap 5 Change tire tire 0 6 second finish lap 1 secondtotal time 2 4 6 2 4 6 1 25 secondsthe minimum time complete race 25 second Constraints1 tireslength 105tiresilength 21 fi changetime 1052 ri 1051 numlap 1000