From b370d8861de85b4fd652648783915154be535e07 Mon Sep 17 00:00:00 2001 From: Ashutosh kumar verma Date: Fri, 16 Oct 2020 22:18:52 +0530 Subject: [PATCH] Create Two sum.cpp --- Two sum.cpp | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 Two sum.cpp diff --git a/Two sum.cpp b/Two sum.cpp new file mode 100644 index 0000000..6e42a1e --- /dev/null +++ b/Two sum.cpp @@ -0,0 +1,26 @@ +Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. + +You may assume that each input would have exactly one solution, and you may not use the same element twice. + +You can return the answer in any order. + + + +class Solution { +public: + vector twoSum(vector& nums, int target) { + int i,j;vectors; + for(i=0;i