GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing leetcode-in-java.github.io — LeetCode-in-Java LeetCode-in-Java3861. Minimum Capacity BoxEasy You are given an integer array The Return an integer denoting the index of the box with the minimum capacity that can store the item. If multiple such boxes exist, return the smallest index. If no box can store the item, return -1. Example 1: Input: capacity = [1,5,3,7], itemSize = 3 Output: 2 Explanation: The box at index 2 has a capacity of 3, which is the minimum capacity that can store the item. Thus, the answer is 2. Example 2: Input: capacity = [3,5,4,3], itemSize = 2 Output: 0 Explanation: The minimum capacity that can store the item is 3, and it appears at indices 0 and 3. Thus, the answer is 0. Example 3: Input: capacity = [4], itemSize = 5 Output: -1 Explanation: No box has enough capacity to store the item, so the answer is -1. Constraints:
Solution
This site is open source. Improve this page.
|
| You are visitor 01402520 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |