摘要:
122 其实更简单的做法是只要是前一个数字比后一个大就相加 public static int maxProfit(int[] prices) { int min = prices[0]; int max = prices[0]; int total = 0; for (int i = 1; i < 阅读全文
posted @ 2021-02-03 17:23
雨落寒沙
阅读(81)
评论(0)
推荐(0)
摘要:
23 合并K个升序链表 首先最简单的当然是建个堆往里面加,优点是基本不需要思考。。。 public static ListNode mergeKLists(ListNode[] lists) { PriorityQueue<ListNode> pq = new PriorityQueue<>((k1 阅读全文
posted @ 2021-02-03 14:29
雨落寒沙
阅读(100)
评论(0)
推荐(0)

浙公网安备 33010602011771号