Hard
Sorting 100,000 ints with <=
This program sorts a vector using <= instead of < as the comparator. What is true about its behavior?
main.cpp
#include <algorithm>
#include <vector>
#include <random>
#include <iostream>
int main() {
std::vector<int> v(100000);
std::mt19937 rng(42);
for (auto& x : v) x = rng() % 1000;
std::sort(v.begin(), v.end(),
[](int a, int b) { return a <= b; });
std::cout << "sorted, size=" << v.size() << "\n";
}85 of 117 in C++