Skip to content

Commit 7624e3f

Browse files
committed
add second week homework
1 parent 3ce4297 commit 7624e3f

2 files changed

Lines changed: 15 additions & 0 deletions

File tree

Week_02/id_19/LeetCode_1_19.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
class Solution {
2+
public int[] twoSum(int[] nums, int target) {
3+
int[] res = new int[2];
4+
for(int i=0;i<nums.length;i++) {
5+
for(int j=i+1;j<nums.length;j++) {
6+
if (nums[i] + nums[j] == target) {
7+
res[0] = i;
8+
res[1] = j;
9+
return res;
10+
}
11+
}
12+
}
13+
return res;
14+
}
15+
}

Week_02/id_19/LeetCode_242_19.java

Whitespace-only changes.

0 commit comments

Comments
 (0)