One Pass Of Lomuto

int partition(std::vector<int> &a, int lo, int hi) {
    int pivot = a[hi];
    int i = lo - 1;
    for (int j = lo; j < hi; j++)
        if (a[j] <= pivot) std::swap(a[++i], a[j]);
    std::swap(a[i + 1], a[hi]);
    return i + 1;
}

The array is [8, 3, 11, 5, 2, 9, 4] and the call is partition(a, 0, 6). What is the array when the function returns?

A

[3, 4, 11, 5, 8, 9, 2]

B

[3, 2, 4, 5, 8, 9, 11]

C

[2, 3, 4, 5, 8, 9, 11]

D

[3, 2, 11, 5, 8, 9, 4]