All challenges

Algorithm challenge · DSA

Two Sum

Difficulty

easy

Time

~20m

Format

Single

Grading

Auto-graded

#dsa#python#javascript#typescript#go#java#cpp#rust
Mission file // read carefullyeasy

Given an array of integers nums and an integer target, return the indices of the two numbers that add up to target. Each input has exactly one solution and you may not use the same element twice. Index order does not matter.

Build with

twoSum(nums: int[], target: int) → int[]
PythonJavaScriptTypeScriptGoJavaC++Rust
5 tests · 2 hidden
Auto-graded on submit
Start challenge

Sign in to save your progress.