mirror of
https://github.com/chefyuan/algorithm-base.git
synced 2024-11-24 13:03:41 +00:00
Update leetcode1两数之和.md
This commit is contained in:
parent
9a8b4f47a4
commit
5908cad71b
@ -100,7 +100,7 @@ public:
|
|||||||
for (int i = 0; i < nums.size(); ++i) {
|
for (int i = 0; i < nums.size(); ++i) {
|
||||||
int t = target - nums[i];
|
int t = target - nums[i];
|
||||||
if (m.count(t)) return { m[t], i };
|
if (m.count(t)) return { m[t], i };
|
||||||
m[A[i]] = i;
|
m[nums[i]] = i;
|
||||||
}
|
}
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user