Update the position of the current element
if ( pos . ContainsKey ( a [ curr ] ) ) pos [ a [ curr ] ] = currElementPos ; else pos . Add ( a [ curr ] , currElementPos ) ; if ( filled . ContainsKey ( currElementPos ) ) filled [ currElementPos ] = true ; else filled . Add ( currElementPos , true ) ; }