Untitled

 avatar
unknown
javascript
4 years ago
289 B
5
Indexable
const twoSum = function(nums, target) {
    for (let first = 0; first < nums.length; first++) {
        for (let second = 0; second < nums.length; second++) {
            if (nums[first] + nums[second] == target && first != second)
                return [first, second]
        }
    }
};
Editor is loading...