Skip to content

2sumsolution

📊 Project Details

  • Primary Language: Python
  • Languages Used: Python
  • License: None
  • Created: August 09, 2023
  • Last Updated: August 09, 2023

📝 About

2 Sum Solution

Language: Python 3

Description

Given an array of integers, return indices of the two numbers such that they add up to a specific target.

You may assume that each input would have exactly one solution (in the easy versions), and you may not use the same element twice.

For the hard version, you can have multiple solutions. Each solution must be a unique pair of numbers. Additionally, you cannot fit the whole array into memory, and you cannot assume that the array is sorted