Final step to store all the column number of 1 st and 3 rd cell upto MidRow
for ( j = Math . min ( v [ i ] [ 0 ] , MidRow ) ; j <= Math . max ( v [ i ] [ 0 ] , MidRow ) ; j ++ ) { s . add ( [ j , v [ i ] [ 0 ] ] ) ; } } return s . size - 2 ; }