Skip to content

Instantly share code, notes, and snippets.

View fullstuck's full-sized avatar

Muhammad Alif fullstuck

View GitHub Profile
function twoSums(nums, target){
let start = 0;
for(let i = 1; i < nums.length; i++){
let curr = nums[start];
if(curr + nums[i] == target)
return [start, i]
if(i == nums.length - 1){
start++
i = start