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