We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 904c857 commit dc28ac4Copy full SHA for dc28ac4
C++/median-of-two-sorted-arrays.cpp
@@ -25,7 +25,7 @@ class Solution {
25
int left = 0;
26
int right = m;
27
// Find a partition of A and B
28
- // where min left s.t. A[left] >= B[k - 1 - left]. Thus left is the (k + 1)-th element.
+ // where min left s.t. A[left - 1] >= B[k - 1 - left]. Thus left is the k-th element.
29
while (left < right) {
30
int mid = left + (right - left) / 2;
31
if (0 <= k - 1 - mid && k - 1 - mid < n && A[mid] >= B[k - 1 - mid]) {
0 commit comments