convert the number to string and find if it contains 1 , 2 & 3.
bool findContainsOneTwoThree ( int number ) { string str = to_string ( number ) ; int countOnes = 0 , countTwo = 0 , countThree = 0 ; for ( int i = 0 ; i < str . length ( ) ; i ++ ) { if ( str [ i ] == '1' ) countOnes ++ ; else if ( str [ i ] == '2' ) countTwo ++ ; else if ( str [ i ] == '3' ) countThree ++ ; } return ( countOnes && countTwo && countThree ) ; }