Skip to content

Commit ab76aec

Browse files
committed
WEEK 1 Solutions
1 parent df78dc2 commit ab76aec

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

two-sum/juhui-jeong.java

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

0 commit comments

Comments
 (0)