I tried to make a set out of this struct and it gives compilation error
struct triplet{
int first;
int second;
int index;
bool operator < (const triplet &A){
if(first==A.first)return second < A.second;
return first < A.first;
}
};
The operator works while simple sorting but is giving error while implementing sets, maps and priority_queues.