Check if X can be converted to Y by converting to 3 * ( X / 2 ) or X | Function to check if X can be made equal to Y by converting X to ( 3 * X / 2 ) or ( X - 1 ) ; Conditions for possible conversion ; Otherwise , conversion is not possible ; Driver Code
function check ( X , Y ) { if ( X > 3 ) { document . write ( " " ) ; } else if ( X == 1 && Y == 1 ) { document . write ( " " ) ; } else if ( X == 2 && Y <= 3 ) { document . write ( " " ) ; } else if ( X == 3 && Y <= 3 ) { document . write ( " " ) ; } else { document . write ( " " ) ; } } let X = 6 , Y = 8 ; check ( X , Y ) ;