myCompare function

I dont understand it (mainly return line)…pls help me out!
Code(Sanjay’s new job):-
https://ide.codingblocks.com/s/69155

@divyam.arora88 hey divayam please save your code on ide and share in this thread

I hv shared the code link pls check it out…

@divyam.arora88 your code is running perfectly fine please try to submit it once again

Actually i want to know mainly abt the return p1.first<p2.first line ?? i dont understand why sir wrote this and not
return p1.first>p2.first

@divyam.arora88 hey divyam prateek bhaiya told that at video duration time 11:55
the pair contains
1 string 2 salary
so if both pair salary is same so we sort string lexographically
this mean
alphabetically order
ALice comes first bob
because in alphabet
a comes first than b

yeah that’s ok but i wanna know that how p2.first is Alice and not Bob???In some cases p2 may start with A and p1 with any other character say G then it will return string with G character first!!

@divyam.arora88 hey divyam in video bhaiya dry run taking p2 as alice and p1 as bob consider that case and dry run on it .and your next query need more elaboration

Hey Divyam,
As you are not responding to this thread, I am marking your doubt as Resolved for now. Re-open it if required.

Please mark your doubts as resolved in your course’s “ Ask Doubt ” section, when your doubt is resolved.