querying the bit array
def query ( idx , bit , n ) : NEW_LINE INDENT summ = 0 NEW_LINE while idx : NEW_LINE INDENT summ += bit [ idx ] NEW_LINE idx -= idx & - idx NEW_LINE DEDENT return summ NEW_LINE DEDENT def answeringQueries ( arr , n , queries , q ) : NEW_LINE