text: 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 .
code: boolean arr [ ] = new boolean [ 10 ] ; for ( int i = 0 ; i < 10 ; i ++ ) arr [ i ] = false ;