Traversing completely overlapped blocks in range for such blocks bit array of that block is queried
while l + blk_sz <= r : NEW_LINE INDENT idx = k NEW_LINE while idx > 0 : NEW_LINE INDENT summ += bit [ l // blk_sz ] [ idx ] NEW_LINE idx -= ( idx & - idx ) NEW_LINE DEDENT l += blk_sz NEW_LINE DEDENT