Skip to content

Commit 3848180

Browse files
committed
Two Sum
1 parent 8f18862 commit 3848180

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

two-sum/casentino.ts

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

0 commit comments

Comments
 (0)