PHP
Code
# Code
```php []
class Solution {

    /**
     * @param Integer[] $nums
     * @param Integer $k
     * @return Integer
     */
    public function minCapability(array $nums, int $k): int {
        $left = min($nums);
        $right = max($nums);
        $result = $right;
    
        while ($left <= $right) {
            $mid = intdiv($left + $right, 2);
            if ($this->canRobAtLeastK($nums, $mid, $k)) {
                $result = $mid;
                $right = $mid - 1;
            } 
            else {
                $left = $mid + 1;
            }
        }
        return $result;
    }
    
    private function canRobAtLeastK(array $nums, int $capability, int $k): bool {
        $count = 0;
        $i = 0;
        
        while ($i < count($nums)) {
            if ($nums[$i] <= $capability) {
                $count++;
                if ($count == $k) { return true; }
                $i++;
            }
            $i++;
        }
        return false;        
    }
}
```
['PHP']