Number of hours after which the second person moves ahead of the first person if they travel at a given speed | Function to return the number of hours for the second person to move ahead ; Time taken to equalize ; Time taken to move ahead ; Driver code
function findHours ( a , b , k ) { if ( a >= b ) return - 1 ; let time = k / ( b - a ) ; time = time + 1 ; return time ; } let a = 4 , b = 5 , k = 1 ; document . write ( findHours ( a , b , k ) ) ;