Check if it is possible to move from ( a , 0 ) to ( b , 0 ) with given jumps | Function to check if it is possible ; Driver code ; function call
function Move ( a , x , b ) { if ( ( ( ( b - a ) % x == 0 ) || ( ( b - a - 1 ) % x == 0 ) && a + 1 != b ) && b >= a ) return true ; return false ; } let a = 3 , x = 2 , b = 7 ; if ( Move ( a , x , b ) ) document . write ( " " ) ; else document . write ( " " ) ;