Arrays & StringsTwo Sum
Progress
solution.py
⌘↵ run
Loading...

Two Sum

easy
You've got this! Start small, think out loud.

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. You may not use the same element twice.

Time:O(n)
Space:O(n)
google-favoritehash-mapcommon-pattern
OUTPUT

Run your code to see output