dp where dp[x] represents the minimum time to finish x laps.dp array for up to 18 laps.x from 1 to numLaps, calculate dp[x] by considering all possible j where j is the lap at which we last changed tires. The state transition is dp[x] = min(dp[x], dp[j] + changeTime + dp[x-j]).dp[numLaps] as the minimum time to finish the race.