time Varies
space Varies
State Variables
target9
Target9
2
[0]
7
[1]
11
[2]
15
[3]
Start iterating through the array.
Pseudocode
Pseudocode
1function twoSum(nums, target):
2 for i = 0 to nums.length - 1:
3 for j = i + 1 to nums.length - 1:
4 if nums[i] + nums[j] == target:
5 return [i, j]
6 return []