首页 > 代码库 > Leetcode Two Sum

Leetcode Two Sum

struct Node{
    int index;
    int value;
};

bool compare(Node a, Node b)
{
    return a.value < b.value;
}

class Solution {
public:
    vector<int> twoSum(vector<int> &numbers, int target) {
        
        
        int i = 0;
        int size = numbers.size();
        int index2 = 0;
        
        vector<Node> nodes;
        vector<int> result;
        
        
        for(i = 0; i < size; i++){
            Node temp;
            temp.index = i + 1;
            temp.value = http://www.mamicode.com/numbers[i];>

Leetcode Two Sum