j is used as a counter for ranges
for ( int j = 0 ; j < ranges . size ( ) ; j ++ ) { int start = ranges [ j ] . first ; int end = ranges [ j ] . second ; for ( int i = prev + 1 ; i < start ; i ++ ) ans . push_back ( i ) ; prev = end ; }