Unable to implement stable sort


#1

Can anybody help me about how to implement stable sort in decreasing order ? I’ve tried implementing it using custom function and also using stable_sort but it’s giving random output. Can anybody help?


#2

Update: Modified comparator function helped solve the problem.