Unverified Commit 0481762e authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

fix a silly bug in maxK

parent 24177dc7
......@@ -136,7 +136,7 @@ public:
if ((k > l && k < r) || l == 0 || r == end - 1) {
return k;
} else if (k <= l) {
return ArgMaxAtK(arr, start, l, k);
return ArgMaxAtK(arr, start, l + 1, k);
} else {
return ArgMaxAtK(arr, r, end, k);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment