摘要:
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 阅读全文
摘要:
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]) 阅读全文
摘要:
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 阅读全文