Skip to main content

Fenwick trees · 5 minutes

Walk the Fenwick prefix blocks

Get feedback on your answer. No account needed.

What does this Python code print?

index = 13
blocks = []
while index:
    blocks.append(str(index))
    index -= index & -index
print(",".join(blocks))

Enter the exact output as one line.

Your answer
Need a small hint?

Subtract the lowest set bit at each step.

This helps us choose when to schedule your next review.