Finds reverse of given num x .
function reverseNum ( x ) { let s = x . toString ( ) ; let str = " " ; for ( let i = s . length - 1 ; i >= 0 ; i -- ) { str = str + s [ i ] ; } let rev = parseInt ( str ) ; return rev ; } function isMysteryNumber ( n ) { for ( let i = 1 ; i <= Math . floor ( n / 2 ) ; i ++ ) {