class Solution {
public:
vector<int> sumZero(int n) {
vector<int> ans(n,0);
int cnt = 0;
int key = 2000;
for(int i=0;i<n/2;i++){
ans[cnt++] = key;
ans[cnt++] = -key;
key++;
}
return ans;
}
};
No.173 - LeetCode1304
最新推荐文章于 2024-07-22 16:27:42 发布