Finds reverse of given num x .
int reverseNum ( int x ) { string s = to_string ( x ) ; reverse ( s . begin ( ) , s . end ( ) ) ; stringstream ss ( s ) ; int rev = 0 ; ss >> rev ; return rev ; } bool isMysteryNumber ( int n ) { for ( int i = 1 ; i <= n / 2 ; i ++ ) {