diff --git a/C++/src/1. Two Sum/TwoSum.cpp b/C++/src/1. Two Sum/TwoSum.cpp index 51befca..7da6bcb 100644 --- a/C++/src/1. Two Sum/TwoSum.cpp +++ b/C++/src/1. Two Sum/TwoSum.cpp @@ -12,9 +12,7 @@ namespace TwoSum{ {//Loop through the dataset if (nums[i] + nums[j] == target) {//Check sum - { - return vector(i, j); - } + return vector() = {i, j}; } } } diff --git a/C++/src/main.cpp b/C++/src/main.cpp index 4705c67..40e81ee 100644 --- a/C++/src/main.cpp +++ b/C++/src/main.cpp @@ -1,5 +1,10 @@ #include +#include +#include "1. Two Sum/TwoSum.cpp" int main() { + std::vector nums = { 3,2,4 }; + TwoSum::Solution twoSum; + std::cout << twoSum.twoSum(nums, 6)[0]; } \ No newline at end of file