/*
 * @lc app=leetcode id=1 lang=cpp
 *
 * [1] Two Sum
 */
#include <bits/stdc++.h>
using namespace std;
class Solution
{
public:
    vector<int> twoSum(vector<int> &nums, int target)
    {
        unordered_map<int, int> m;
        for (int i = 0; i < nums.size(); i++)
        {
            auto ite = m.find(target - nums[i]);
            if (ite != m.end())
                return {ite->second, i};
            m[nums[i]] = i;
        }
        return {0, 0};
    }
};
