how to sort a given vector of pairs in c++ code example
Example: Sort by the distance between pairs c++
sort(begin(data), end(data),
[](pair<int, int> const& a, pair<int, int> const& b)
{
return abs(a.first-a.second)<abs(b.first-b.second);
});