LeetCode / Two Sum
Problem
- Link
- Description
- Find two numbers that sum to the target number and return their indices
- Type
- Brute Force
Solution 1
| |
- Description
- Performs brute force search without duplicates
- Time Complexity
- O(len(nums)^2)
- Two nested for loops of size len(nums)
- Space Complexity
- O(len(nums))
- Memory usage proportional to len(nums) for function input