End of Year Sale: Use Coupon Code END2025 to Get Extra 25% Off.
left to 1 and right to the maximum value in nums (1e9).mid as the average of left and right.
b. Use a greedy approach to count the number of houses that can be robbed with capability mid without robbing adjacent houses.
c. If the count is at least k, update right to mid. Otherwise, update left to mid + 1.left is equal to right, which will be the minimum capability required.left as the answer.