题目详情
题目链接
解法
解法1
我直接用找最小值的算法来
class Solution {
public int inventoryManagement(int[] stock) {
int res = 50010;
for(int i=0;i<stock.length;i++){
res = stock[i]<res?stock[i]:res;
}
return res;
}
}
解法2
二分,这个我还在看