Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // bool compare(node a, node b){
- // if(a.salary < b.salary){
- // return true;
- // }
- // if(a.salary ==b.salary){
- // return a.name <b.name;
- // }
- // return false;
- // }
- class Solution{
- public:
- void sortRecords(node arr[], int n)
- {
- // Your code goes here
- sort(arr,arr+n,[](node a, node b){
- if(a.salary < b.salary){
- return true;
- }
- if(a.salary ==b.salary){
- return a.name <b.name;
- }
- return false;
- });
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement