initialising bit array of each block as elements of array cannot exceed 10 ^ 4 so size of bit array is accordingly
bit = [ [ 0 for i in range ( MAX ) ] for j in range ( blk_sz + 1 ) ] NEW_LINE preprocess ( arr , blk_sz , n , bit ) NEW_LINE print ( query ( 1 , 3 , 1 , arr , blk_sz , bit ) ) NEW_LINE preprocessUpdate ( 3 , 10 , blk_sz , arr , bit ) NEW_LINE print ( query ( 3 , 3 , 4 , arr , blk_sz , bit ) ) NEW_LINE preprocessUpdate ( 2 , 1 , blk_sz , arr , bit ) NEW_LINE preprocessUpdate ( 0 , 2 , blk_sz , arr , bit ) NEW_LINE print ( query ( 0 , 4 , 5 , arr , blk_sz , bit ) ) NEW_LINE