Skip to content

Commit 1fbf055

Browse files
authored
two-sum solution
1 parent 2b0b020 commit 1fbf055

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

two-sum/Lustellz.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
function twoSum(nums: number[], target: number){
2+
for(let i = 0; i < nums.length; i++){
3+
for(let j = i+1; nums.length-j;j++)
4+
if(nums[j] === target - nums[i]) return [i, j]
5+
}
6+
};

0 commit comments

Comments
 (0)