Create an array of size 10 and initialize all elements as false . This array is used to check if a digit is already seen or not .
bool arr [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) arr [ i ] = false ;