Run to execute this JavaScript code for real (output appears here).
Ready.
Finds two indexes whose values add up to a target in one pass, storing each value's index in a hash map and looking up the complement (target − value). Press Run (Ctrl + Enter) to animate, or Step forward (F10) to go one event at a time.
Step
1 / 22
Line (JavaScript)
—
main (no active function frames)
No counted operations yet.
[3, 8, 11, 2, 7, 15]