diff --git a/src/TwoSum/README.md b/src/TwoSum/README.md new file mode 100644 index 0000000..8882c3a --- /dev/null +++ b/src/TwoSum/README.md @@ -0,0 +1,9 @@ +# Reverse Integer + +LeetCode [source](https://leetcode.com/problems/two-sum/) + +## AC Result + +| Status | Runtime | Memory | +|--------|---------|--------| +| Accepted | 364 ms | 9.3 MB | \ No newline at end of file diff --git a/src/TwoSum/Solution.cpp b/src/TwoSum/Solution.cpp new file mode 100644 index 0000000..0c1e2eb --- /dev/null +++ b/src/TwoSum/Solution.cpp @@ -0,0 +1,43 @@ +#include +#include +#include + +using namespace std; + +class Solution{ +public: + vector twoSum(vector nums, int target){ + + vector result; + int second_number; + + for(int i=0; i nums; + nums.push_back(3); + nums.push_back(2); + nums.push_back(4); + + int target = 6; + + vector result = s.twoSum(nums, target); + cout<