diff --git a/website/content/ChapterFour/0001~0099/0001.Two-Sum.md b/website/content/ChapterFour/0001~0099/0001.Two-Sum.md index d84bc7af1..d1881f3a4 100644 --- a/website/content/ChapterFour/0001~0099/0001.Two-Sum.md +++ b/website/content/ChapterFour/0001~0099/0001.Two-Sum.md @@ -39,8 +39,8 @@ func twoSum(nums []int, target int) []int { m := make(map[int]int) for i := 0; i < len(nums); i++ { another := target - nums[i] - if _, ok := m[another]; ok { - return []int{m[another], i} + if index, ok := m[another]; ok { + return []int{index, i} } m[nums[i]] = i }