随笔分类 -  Leecode每日刷题

摘要:654. 最大二叉树 105. 从前序与中序遍历序列构造二叉树 106. 从中序与后序遍历序列构造二叉树 阅读全文
posted @ 2021-06-02 10:48 codeDJH 阅读(46) 评论(0) 推荐(0)
摘要:相关题目参见blog https://labuladong.gitee.io/algo/1/8/ 阅读全文
posted @ 2021-05-24 13:14 codeDJH 阅读(30) 评论(0) 推荐(0)
摘要:动态规划 363. 矩形区域不超过 K 的最大数值和 hard class Solution { public int maxSumSubmatrix(int[][] matrix, int k) { int m = matrix.length; int n = matrix[0].length; 阅读全文
posted @ 2021-04-23 10:51 codeDJH 阅读(53) 评论(0) 推荐(0)
摘要:27. 移除元素 class Solution { public int removeElement(int[] nums, int val) { int len = nums.length; for(int i = len - 1; i >= 0; i--){ if(nums[i] == val) 阅读全文
posted @ 2021-04-19 21:22 codeDJH 阅读(93) 评论(0) 推荐(0)
摘要:双指针 392. 判断子序列 class Solution { public boolean isSubsequence(String s, String t) { int i = 0; int j = 0; int n = s.length(); int m = t.length(); while 阅读全文
posted @ 2021-04-19 09:41 codeDJH 阅读(37) 评论(0) 推荐(0)
摘要:滑动窗口 219. 存在重复元素 II 给定一个整数数组和一个整数 k,判断数组中是否存在两个不同的索引 i 和 j,使得 nums [i] = nums [j],并且 i 和 j 的差的 绝对值 至多为 k。 // 滑动窗口做法 class Solution { public boolean co 阅读全文
posted @ 2021-04-17 11:26 codeDJH 阅读(98) 评论(0) 推荐(0)