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.
Here
Operator can't change triplet. Otherwise it would be hard to balance BST :D
Thankyou so much!!