摘要:
class MaxQueue { Queue<Integer> queue; LinkedList<Integer> max; public MaxQueue() { queue = new LinkedList<>(); max = new LinkedList<>(); } public int 阅读全文
摘要:
public int maxProfit(int[] prices) { int n = prices.length; if(n == 0) return 0; int[] x = new int[n]; x[0] = prices[0]; int max = -1; for(int i = 1;i 阅读全文
摘要:
public int sumNums(int n) { boolean flag = n > 0 && (n+=sumNums(n-1))>0; return n; } public int sumNums(int n) { return IntStream.range(1,n+1).sum(); 阅读全文