Skip to content

Commit 6f46427

Browse files
author
applewjg
committed
update
Change-Id: If026b9bc900ed35c4e4dbc33ad0110a14bfa334a
1 parent 85bc9a9 commit 6f46427

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

FindPeakElement.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Solution {
1717
public:
1818
int findPeakElement(const vector<int> &num) {
1919
int n = num.size();
20-
int left = 0, right = n - 1,mid;
20+
int left = 0, right = n - 1,mid = -1;
2121
while (left <= right) {
2222
mid = (left + right) / 2;
2323
if ((mid == 0 || num[mid-1] <= num[mid]) && (mid == n -1 || num[mid+1] <= num[mid]))

0 commit comments

Comments
 (0)