Utility Function to answer the queries
void getDistinctCount ( vector < vector < int > > & queries , int ar [ ] , long long seg [ ] , int n ) { for ( int i = 0 ; i < queries . size ( ) ; i ++ ) { int op = queries [ i ] [ 0 ] ; if ( op == 2 ) { int l = queries [ i ] [ 1 ] , r = queries [ i ] [ 2 ] ; long long tempMask = query ( 0 , n - 1 , l - 1 , r - 1 , 1 , seg ) ; int countOfBits = 0 ;