How would i know that a>=b or b>=?

how would i know that a>=b or b>=a.
i mean that is “b” the key here ? how ?

see internally the cmp function works on the basics of randomised quick sort
so 2 variables are sent randomly for the sorting to happen
by key what do u mean?

its simply 2 values of same type present in the array

yeah i got it
but is variable “b” the key or variable “a” ? how come i will know that ?

comparision with a are done so primarily a is the key
it is the point of comparison

eg if u wanted sorted in increasing then
a < b has to be returned

okay
also tell me from where -1 came ?

what is trying to do is getting the result by subtracting the index
like earlier the answer came at index 7
so simply by deducting by 1
we get to the desired result