js chort && fast


  • 0
    R
    var twoSum = function(nums, target) {
        var result=[];
        nums.some(function(num,index){
            var tmp=nums.indexOf(target-num)>-1 && nums.indexOf(target-num)!=index
            tmp && result.push(index,nums.indexOf(target-num))
            return tmp
        })
        return result
    };
    

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.