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