price array in ascending order.left to 0 and right to the maximum possible difference in price.left is less than right, perform the following steps:
a. Calculate mid as the average of left and right.
b. Use a greedy approach to check if it's possible to pick k candies such that the difference between any two consecutive selected candies is at least mid.
c. If it's possible, update left to mid + 1 (to try a larger difference), otherwise update right to mid.left - 1 after the loop ends.