diff --git a/1304. Find N Unique Integers Sum up to Zero b/1304. Find N Unique Integers Sum up to Zero new file mode 100644 index 0000000..441e855 --- /dev/null +++ b/1304. Find N Unique Integers Sum up to Zero @@ -0,0 +1,10 @@ +class Solution { +public: + vector sumZero(int n) { + vector ans; + for(int i =n/2;i>=1;i--){ans.push_back(-i);} + if(n%2!=0){ans.push_back(0);}; + for(int i =1;i<=n/2;i++){ans.push_back(i);} + return ans; + } +};