Created
February 1, 2018 04:43
-
-
Save Mk-Etlinger/2116d70268e87dd7b5ded7cbf3d1bf51 to your computer and use it in GitHub Desktop.
Leetcode twoSum #1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var twoSum = function(nums, target) { | |
| let indicesArray = []; | |
| for (let i = 0; i < nums.length; i++) { | |
| for (let k = i + 1; k < nums.length; k++) { | |
| if (nums[i] + nums[k] === target) { | |
| indicesArray.push(i, k) | |
| } | |
| } | |
| } | |
| return indicesArray; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment