Skip to content

Commit 83d128d

Browse files
committed
note
1 parent 34149ad commit 83d128d

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎src/main/java/com/chen/algorithm/znn/array/test26/Solution.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public int removeDuplicates(int[] nums) {
3232

3333
int i = 0;
3434
for (int j = 0; j < nums.length; j++) {
35-
if (nums[j] != nums[i]) {
35+
if (nums[j] != nums[i]) { // 不相等的重新放入数组中,重新组成无重复数组
3636
i++;
3737
nums[i] = nums[j];
3838
}

‎src/main/java/com/chen/algorithm/znn/note‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,16 +63,16 @@ sort
6363
快速排序 sort/QuickSort (nlogn 不稳定)**
6464

6565
string
66-
3. 无重复字符的最长子串 *** 滑动窗口
67-
5. 最长回文子串 动态规划
66+
3. 无重复字符的最长子串 *** 滑动窗口,Map<Character,Integer>,start = Math.max(start, map.get(c));map.put(c, end+1);res = Math.max(res, end-start+1);
67+
5. 最长回文子串 动态规划 dp[i][j]表示字符串 s 的第 i 到 j 个字母组成的串是否是回文串(x 表示增量,子串长度,)
6868
14. 最长公共前缀 ***
6969
415. 字符串相加
7070

7171
hash
7272
15. 三数之和 *** 排序+双指针
7373
18. 四数之和 ??? 排序+双指针
7474
49. 字母异位词分组 *** 排序+map
75-
242. 有效的字母异位词 *** 哈希表
75+
242. 有效的字母异位词 *** 迭代,int[] counter = new int[26];counter[s.charAt(i) - 'a']++;counter[t.charAt(i) - 'a']--;if(counter[i] != 0){return false;}
7676

7777
array
7878
剑指 Offer 29. 顺时针打印矩阵 left right top bottom

0 commit comments

Comments
 (0)