摘要:
leetcode每日一题 396. 旋转函数 1.暴力破解 超时 class Solution { public int maxRotateFunction(int[] nums) { if(nums.length == 1){ return 0; } int max = Integer.MIN_V 阅读全文
摘要:
leetcode每日一题 388. 文件的最长绝对路径 1.先考虑各种情况,然后写公共情况,代码没优化,leetcode跑和本地测试结果不一样,没去往下做了 class Solution { public int lengthLongestPath(String input) { //不是目录的情况 阅读全文
摘要:
并发处理多任务(CompletableFuture) 1.开启多线程处理多任务并返回结果 public class Demo1 { private static LongAdder longAdder = new LongAdder(); public static void main(Stri 阅读全文
摘要:
leetcode每日一题 821. 字符的最短距离 1.普通双指针 class Solution { public int[] shortestToChar(String s, char c) { int[] result = new int[s.length()]; int l = 0; int 阅读全文
摘要:
leetcode每日一题 386. 字典序排数 public List<Integer> lexicalOrder(int n) { List<Integer> list = new ArrayList<>(n); for (int i = 1; i < 10; i++) { f(list, n, 阅读全文
摘要:
leetcode每日一题 1672. 最富有客户的资产总量 java8 解决 流比for循环慢,所以性能较低,int转Integer也存在性能损耗 class Solution { public int maximumWealth(int[][] accounts) { int[] max = ne 阅读全文