Update Leetcode 题解 - 双指针.md

Fix the typo
This commit is contained in:
Neo Cui 2021-11-17 21:56:30 +08:00 committed by GitHub
parent 456ff183d5
commit fff80d4dc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -39,7 +39,7 @@ Output: index1=1, index2=2
```java ```java
public int[] twoSum(int[] numbers, int target) { public int[] twoSum(int[] numbers, int target) {
if (numbers == null) return null; if (numbers == null) return null;
int i = 0, j = numbers.length - 1; int i = 0, j = numbers.Length - 1;
while (i < j) { while (i < j) {
int sum = numbers[i] + numbers[j]; int sum = numbers[i] + numbers[j];
if (sum == target) { if (sum == target) {