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 3339b11 commit b6876f9Copy full SHA for b6876f9
JooKangSan/[week9]Sort/Pick_two_and_add_them
@@ -0,0 +1,11 @@
1
+function solution(numbers) {
2
+ const result = new Set();
3
+
4
+ for(let i = 0; i < numbers.length; i++) {
5
+ for(let j = i + 1; j < numbers.length; j++) {
6
+ result.add(numbers[i] + numbers[j]);
7
+ }
8
9
10
+ return [...result].sort((a, b) => a - b);
11
+}
0 commit comments