I am trying to solve SORT2D, the approach I am thinking of is using a vector<pair<int,int>> v and then sort(v.begin(),v.end() but then how do I compare the y co-ordinate’s position when x values are equal?
vector<pair<int,int>> v
sort(v.begin(),v.end()
you have to use comparator here, you can read about it here This code can help.