We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8694351 commit 331436eCopy full SHA for 331436e
1304.data
@@ -0,0 +1,3 @@
1
+5
2
+3
3
+1
1304.和为零的N个唯一整数.js
@@ -0,0 +1,26 @@
+/*
+ * @lc app=leetcode.cn id=1304 lang=javascript
+ *
4
+ * [1304] 和为零的N个唯一整数
5
+ */
6
+
7
+ // @lc code=start
8
+/**
9
+ * @param {number} n
10
+ * @return {number[]}
11
12
+var sumZero = function(n) {
13
+ const result = [];
14
15
+ if (n % 2 !== 0) {
16
+ result.push(0);
17
+ }
18
19
+ for (let i = 1; i <= n / 2; i++) {
20
+ result.unshift(-i);
21
+ result.push(i);
22
23
24
+ return result;
25
+};
26
+// @lc code=end
0 commit comments