这篇用来放做的leetcode题目
1.Two Sum
用的暴力的O(n2)
class Solution { public: vector<int> twoSum(vector<int>& nums, int target) { vector<int> ans; for (int i = 0;i < nums.size();i++) { for (int j = i + 1;j < nums.size();j++) { if (nums[i] + nums[j] == target) { ans.push_back(i); ans.push_back(j); return ans; } } } } };