Inbuilt Sort C++

What does ending numerical value a+n means and in the bool compare function why are we returning a>b?

@vanshikasharma1645 a+n means we are sorting array till nth element means upto index<n.
inbuilt sort function give as array in ascending order if we want array in descending order we can use custom compare like this which swaps value if right side element is greater than left side.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.