Simple Solution using Binary Search
Minimize Maximum Capability of Robbing HousesIntuitionWe need to find the minimum capability C such that we can rob at least k houses while following the rule t
# Minimize Maximum Capability of Robbing Houses

## Intuition
We need to find the minimum capability `C` such that we can rob at least `k` houses while following the rule that no two adjacent houses can be robbed.  
Since we are searching for the smallest possible `C`, binary search is a good approach.

## Approach
1. **Binary Search on Capability**  
   - The minimum possible capability (`left`) is the smallest number in `nums`, and the maximum (`right`) is the largest number.
   - Perform binary search between `left` and `right`.
   - For each `mid` (candidate capability), check if we can rob `k` houses with `≤ mid` capability.

2. **Greedy Checking (canRobWithCapability)**
   - Traverse `nums` and count how many houses can be robbed under capability `≤ mid`.
   - If we rob a house, we skip the next one to maintain the non-adjacent constraint.
   - If at least `k` houses are robbed, return `true`; otherwise, return `false`.

## Complexity
- **Time Complexity**:  
  - **Binary Search**: $$O(\log M)$$, where `M` is the range of values in `nums`.  
  - **Checking Feasibility**: $$O(N)$$, where `N` is the size of `nums`.  
  - **Total Complexity**: $$O(N \log M)$$.

- **Space Complexity**: $$O(1)$$ (constant extra space).

## Code
```java
class Solution {
    public int minCapability(int[] nums, int k) {
        int left = Integer.MAX_VALUE, right = Integer.MIN_VALUE;
        
        // Finding min and max in nums
        for (int num : nums) {
            left = Math.min(left, num);
            right = Math.max(right, num);
        }

        // Binary search on possible capability values
        while (left < right) {
            int mid = left + (right - left) / 2;
            
            // Check if we can rob at least k houses with capability <= mid
            if (canRobWithCapability(nums, mid, k)) {
                right = mid; // Try a smaller capability
            } else {
                left = mid + 1; // Increase the capability
            }
        }
        return left;
    }

    private boolean canRobWithCapability(int[] nums, int cap, int k) {
        int count = 0;
        int n = nums.length;
        
        for (int i = 0; i < n; i++) {
            if (nums[i] <= cap) { // If the house can be robbed under this capability
                count++;
                i++; // Skip next house to ensure non-adjacent robbing
            }
            if (count >= k) return true; // Early exit if we already robbed k houses
        }
        
        return false;
    }
}

['Array', 'Binary Search', 'Java']