From e24d6ffa18cc2c4fa899ee48aae875dd98f6073a Mon Sep 17 00:00:00 2001 From: HarshitTiwari-20 Date: Wed, 8 Oct 2025 01:28:08 +0530 Subject: [PATCH] Add 2sum solution in C++ --- C++/2sum.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 C++/2sum.cpp diff --git a/C++/2sum.cpp b/C++/2sum.cpp new file mode 100644 index 0000000..a72bfe3 --- /dev/null +++ b/C++/2sum.cpp @@ -0,0 +1,16 @@ +class Solution { +public: + vector twoSum(vector& nums, int target) { + map mpp; + int n = nums.size(); + for(int i = 0; i