Swapping the bits if lesser significant is greater than higher significant bit and accordingly modifying the number
if ( m > n ) { let x = ( 1 << i 1 << j ) ; num = num ^ x ; } i ++ ; j -- ; } return num ; }