diff --git a/problems/0018.四数之和.md b/problems/0018.四数之和.md index 2146a114..99613070 100644 --- a/problems/0018.四数之和.md +++ b/problems/0018.四数之和.md @@ -153,7 +153,7 @@ class Solution { int left = j + 1; int right = nums.length - 1; while (right > left) { - int sum = nums[i] + nums[j] + nums[left] + nums[right]; + long sum = (long) nums[i] + nums[j] + nums[left] + nums[right]; if (sum > target) { right--; } else if (sum < target) {