Traverse the array w [ ] & update positions jumps array a [ ]
for ( int i = 0 ; i < n ; i ++ ) { if ( pos . ContainsKey ( w [ i ] ) ) pos [ w [ i ] ] = i ; else pos . Add ( w [ i ] , i ) ; if ( filled . ContainsKey ( w [ i ] ) ) filled [ i ] = true ; else filled . Add ( i , true ) ; if ( jump . ContainsKey ( w [ i ] ) ) jump [ w [ i ] ] = l [ i ] ; else jump . Add ( w [ i ] , l [ i ] ) ; a [ i ] = w [ i ] ; }