From 4a742ac73030a2f13c218ccc63cd092f97a3ae28 Mon Sep 17 00:00:00 2001 From: chayan das <110921638+Chayandas07@users.noreply.github.com> Date: Sat, 28 Dec 2024 00:21:26 +0530 Subject: [PATCH] Create 28 December Find All Triplets with Zero Sum --- 28 December Find All Triplets with Zero Sum | 26 ++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 28 December Find All Triplets with Zero Sum diff --git a/28 December Find All Triplets with Zero Sum b/28 December Find All Triplets with Zero Sum new file mode 100644 index 0000000..a666d94 --- /dev/null +++ b/28 December Find All Triplets with Zero Sum @@ -0,0 +1,26 @@ +class Solution { + public: + vector> findTriplets(vector &arr) { + unordered_mapmp; + for(int i=0;i>temp; + for(int i=0;itempo; + tempo.push_back(i); + tempo.push_back(j); + tempo.push_back(mp[ans]); + sort(tempo.begin() ,tempo.end()); + temp.insert(tempo); + } + } + } + vector>temp2(temp.begin() ,temp.end()); + return temp2; + } +};