Skip to content

Commit 5435b58

Browse files
authored
Update Solution.cs
1 parent a766a7e commit 5435b58

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
public class Solution {
22
public int Search(int[] nums, int target) {
3-
int left = 0, right = nums.Length - 1;
4-
while (left < right) {
5-
int mid = (left + right) >> 1;
3+
int l = 0, r = nums.Length - 1;
4+
while (l < r) {
5+
int mid = (l + r) >> 1;
66
if (nums[mid] >= target) {
7-
right = mid;
7+
r = mid;
88
} else {
9-
left = mid + 1;
9+
l = mid + 1;
1010
}
1111
}
12-
return nums[left] == target ? left : -1;
12+
return nums[l] == target ? l : -1;
1313
}
14-
}
14+
}

0 commit comments

Comments
 (0)