AlgoViz
← All drills
🧠 Drill · Think it through

Two friends splitting a bill

The problem

You're given a list of prices and a budget. Return whether any two distinct items add up to exactly the budget. The list is not sorted, and you scan it once.

Don't jump to code. Walk the four questions an expert asks first — you'll build the habit, not just the answer.

1

Restate it

Before anything else — did you read what's actually being asked? Strip the story to the bare goal.

Strip away the story. What are we actually asked to find?