if X is negative take the absolute value of X .
X = abs ( X ) ; if ( has [ X ] [ 1 ] == 1 ) return true ; return false ; } void insert ( int a [ ] , int n ) { for ( int i = 0 ; i < n ; i ++ ) { if ( a [ i ] >= 0 ) has [ a [ i ] ] [ 0 ] = 1 ; else has [ abs ( a [ i ] ) ] [ 1 ] = 1 ; } }