11 2021 档案

摘要:滑动窗口最大值 public int[] maxSlidingWindow(int[] nums, int k) { if(nums == null || k < 1 || nums.length < k) { return new int[0]; } LinkedList<Integer> lis 阅读全文
posted @ 2021-11-23 16:40 现在开始努力 阅读(63) 评论(0) 推荐(0)
摘要:最长公共子序列 class Solution { public int longestCommonSubsequence(String text1, String text2) { char s1[] = text1.toCharArray(); char s2[] = text2.toCharAr 阅读全文
posted @ 2021-11-17 15:05 现在开始努力 阅读(56) 评论(0) 推荐(0)
摘要:省份数量 class Solution { public int findCircleNum(int[][] isConnected) { int N = isConnected.length; Unionfind unionfind = new Unionfind(N); for(int i =  阅读全文
posted @ 2021-11-09 16:58 现在开始努力 阅读(95) 评论(0) 推荐(0)
摘要:折绳子问题(一根绳子,自下向上折叠n次,依次打印展开之后折痕的凹凸) public void process(int i,int n,boolean flag) { // i : 当前层数,n : 最多层数 if(i > n) { return; } process(i + 1,n,true); S 阅读全文
posted @ 2021-11-02 15:59 现在开始努力 阅读(78) 评论(0) 推荐(0)