摘要:
class Solution { public int minFlipsMonoIncr(String s) { int oneNum = 0, flipNum =0; int res =0; for(char c: s.toCharArray()){ if(c=='0'){ if(oneNum== 阅读全文
摘要:
By adding a 'max' and 'min' variable, we can make the solution's time complexity from O(n3) to O(n2): public long subArrayRanges(int[] nums) { long re 阅读全文
摘要:
Solution 1, Using a PriorityQueue class Solution { public int maximumUnits(int[][] boxTypes, int truckSize) { PriorityQueue<int[]> queue = new Priorit 阅读全文