From e1cf69872e91f9381b4aeb6b94e9e1ff44974347 Mon Sep 17 00:00:00 2001 From: chayan das Date: Sun, 7 Sep 2025 20:31:30 +0530 Subject: [PATCH] Create 1304. Find N Unique Integers Sum up to Zero --- 1304. Find N Unique Integers Sum up to Zero | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 1304. Find N Unique Integers Sum up to Zero 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; + } +};