When query type is 2
else { a [ query [ i - 1 ] [ 1 ] ] = query [ i - 1 ] [ 2 ] ; let pos = query [ i - 1 ] [ 1 ] ; let new_val = query [ i - 1 ] [ 2 ] ; update ( 1 , 0 , n - 1 , pos , new_val ) ; } } }