摘要:
lc3 无重复字符的最长子串 滑动窗口 维护不重复的集合,指针向右平移 class Solution { public int lengthOfLongestSubstring(String s) { Set<Character> set = new HashSet<>(); int n = s.l 阅读全文
摘要:
lc5 最长回文子串 1 动态规划 class Solution { public String longestPalindrome(String s) { int len = s.length(); if (len < 2) { return s; } int maxLen = 1, begin 阅读全文
摘要:
模拟 lc1 两数之和 class Solution { public int[] twoSum(int[] nums, int target) { HashMap<Integer, Integer> map = new HashMap<>(); for (int i = 0; i < nums.l 阅读全文