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 1cbc9eb commit cace7c5Copy full SHA for cace7c5
bona1122/[week9]Sort/Pick_two_sum.js
@@ -0,0 +1,14 @@
1
+// https://school.programmers.co.kr/learn/courses/30/lessons/68644
2
+
3
+const solution = numbers => {
4
+ const set = new Set();
5
6
+ for(let i = 0; i < numbers.length; i++){
7
+ for(let j = i + 1; j <numbers.length; j++){
8
+ const num = numbers[i] + numbers[j]
9
+ set.add(num)
10
+ }
11
12
13
+ return [...set].sort((a, b) => a - b)
14
+}
0 commit comments