Skip to content

Two sum #1226

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

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Two sum #1226

Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
indeces => indices
  • Loading branch information
nosecreek committed Oct 24, 2022
commit e847c45eb08cac469a70056997c9148298366d2d
2 changes: 1 addition & 1 deletion Data-Structures/Array/TwoSum.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @description Given an array of integers, returns 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, and you may not use the same element twice. This is a basic brute force approach.
* @param {Array} nums - array of integers.
* @param {number} target - target integer.
* @returns {Array} Array of the indeces of the two numbers whose sum equals the target
* @returns {Array} Array of the indices of the two numbers whose sum equals the target
* @example Given nums = [2, 7, 11, 15], target = 9; return [0, 1] because nums[0] + nums[1] = 2 + 7 = 9
* @complexity: O(n^2)
*/
Expand Down