01 Write
02 Run
03 Explore
04 Improve
00:00:00

Two Sum

easy

arraysloops

Given an array of integers nums and an integer target, return the indices of the two numbers whose sum equals the target.

Each input has exactly one solution. You may not use the same element twice. Return indices in increasing order.

Think through an example
Example 01nums = [2,7,11,15] target = 9 output = [0,1]
Example 02nums = [3,2,4] target = 6 output = [1,2]
First-load internet access is required for the Pyodide runtime. Python executes locally in a browser Web Worker; worker timeout and trace length are bounded. This is not a hardened security sandbox.
Py two_sum.py
Ready
This session only · sign in to saveLn 1, Col 1
Not run yet
Run your solution to see real Python test results.