摘要: class Solution { public int reversePairs(int[] nums) { int left = 0; int right = nums.length-1; int cnt=0; int[] tmp = new int[nums.length]; Arrays.fi 阅读全文
posted @ 2020-10-17 16:40 dlooooo 阅读(119) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int findPeakElement(int[] nums) { if(nums.length==1||nums[0]>nums[1]){ return 0; } if(nums[nums.length-1]>nums[nums.length-2]) 阅读全文
posted @ 2020-10-17 15:44 dlooooo 阅读(67) 评论(0) 推荐(0) 编辑
摘要: class Solution { public int maxProfit(int[] prices) { int len = prices.length; int res = 0; int i = 0; while(i < len - 1){ while(i < len - 1 && prices 阅读全文
posted @ 2020-10-17 15:23 dlooooo 阅读(69) 评论(0) 推荐(0) 编辑