Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pair Sum #40

Open
riddhi-jain opened this issue Aug 3, 2021 · 2 comments
Open

Pair Sum #40

riddhi-jain opened this issue Aug 3, 2021 · 2 comments

Comments

@riddhi-jain
Copy link
Owner

Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target.

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

You can return the answer in any order.

Example 1:

Input: nums = [2,7,11,15], target = 9
Output: [0,1]
Output: Because nums[0] + nums[1] == 9, we return [0, 1].
Example 2:

Input: nums = [3,2,4], target = 6
Output: [1,2]
Example 3:

Input: nums = [3,3], target = 6
Output: [0,1]

Follow-up: A solution with less than O(n^2) time complexity will be merged.

@ankit010201
Copy link

Is this still available to contribute to?

@riddhi-jain
Copy link
Owner Author

yes @ankit010201 .
Feel free to contribute 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants