10 2021 档案

摘要:5. 最长回文子串 1.状态定义 //dp[i][j]表示s[i…j]是否为回文串 2.状态转移方程 dp[i][j] = (s[i] == s[j]) && dp[i + 1][j - 1] 3.边界值处理 dp[i][i] = true class Solution { public Strin 阅读全文
posted @ 2021-10-30 18:10 星予 阅读(52) 评论(0) 推荐(0)
摘要:4. 寻找两个正序数组的中位数 1 class Solution { 2 public double findMedianSortedArrays(int[] nums1, int[] nums2) { 3 int n = nums1.length; 4 int m = nums2.length; 阅读全文
posted @ 2021-10-30 14:47 星予 阅读(64) 评论(0) 推荐(0)
摘要:76. 最小覆盖子串 class Solution { public String minWindow(String s, String t) { //记录字符串当前s窗口中各字符的数量 HashMap<Character, Integer> hs = new HashMap<>(); //记录字符 阅读全文
posted @ 2021-10-29 23:34 星予 阅读(63) 评论(0) 推荐(0)
摘要:/** * Definition for singly-linked list. * public class ListNode { * int val; * ListNode next; * ListNode() {} * ListNode(int val) { this.val = val; } 阅读全文
posted @ 2021-10-29 21:43 星予 阅读(23) 评论(0) 推荐(0)
摘要:class LRUNode{ String key; Object value; LRUNode next; public LRUNode(String key, Object value) { this.key = key; this.value = value; } } public class 阅读全文
posted @ 2021-10-19 15:10 星予 阅读(71) 评论(0) 推荐(0)