There are several consecutive houses along a street, and each house contains some amount of money. A robber wants to rob some of these houses, but they cannot rob two adjacent houses.
The robber’s capability is defined as the maximum amount of money stolen from any single house among all the houses they choose to rob.
Given an integer array nums, where nums[i] represents the amount of money in the i-th house, and an integer k, representing the minimum number of houses the robber must rob, return the minimum possible capability needed to rob at least k non-adjacent houses.
It is guaranteed that robbing at least k houses is always possible.
Constraints:
nums.length
nums[i]
k nums.length
There are several consecutive houses along a street, and each house contains some amount of money. A robber wants to rob some of these houses, but they cannot rob two adjacent houses.
The robber’s capability is defined as the maximum amount of money stolen from any single house among all the houses they choose to rob.
Given an integer array nums, where nums[i] represents the amount of money in the i-th house, and an integer k, representing the minimum number of houses the robber must rob, return the minimum possible capability needed to rob at least k non-adjacent houses.
It is guaranteed that robbing at least k houses is always possible.
Constraints:
nums.length
nums[i]
k nums.length