We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e1cbafe commit a377f09Copy full SHA for a377f09
1 file changed
two-sum/hyejj19.ts
@@ -0,0 +1,8 @@
1
+function twoSum(nums: number[], target: number): number[] {
2
+ for (let lt = 0; lt < nums.length - 1; lt++) {
3
+ for (let rt = lt + 1; rt < nums.length; rt++) {
4
+ if (nums[lt] + nums[rt] === target) return [lt, rt];
5
+ }
6
7
+ return [0, 0];
8
+}
0 commit comments