上周(20260817-20260823)完成Leetcode的LeetCode 75系列题目。 主要目标是快速熟悉算法编程手感,为可能存在笔试题目做准备。现在将题目情况及发现的问题做简要记录。
系列共计75道题目,难度包含简易和中级,考察面覆盖数组/字符串(5E+4M)、双指针(2E+2M)、滑动窗口(1E+3M)、前缀和(2E)、哈希表(2E+2M)、栈(3M)、队列(1E+1M)、链表(1E+3M)、二叉树-深度优先搜索(2E+4M)、二叉树-广度优先搜索(2M)、二叉搜索树(1E+1M)、图-深度优先搜索(4M)、图-广度优先搜索(2M)、堆/优先队列(4M)、二分查找(1E+3M)、回溯(2M)、一维动态规划(2E+2M)、多维动态规划(4M)、位运算(2E+1M)、前缀树(2M)、区间问题(2M)、单调栈(2M)。
系列题目整体做下来还是找到很多知识短板的,太久没有做这种题目,很多基本知识甚至是陌生的,抽象算法落到题目场景中的应用也比较生疏,需要提高。 除基本数据结构应用外,其余的树、图、动态规划、堆、二分查找等方面仍需继续提升。
数组/字符串
- [简单] 1768. Merge Strings Alternately
- [简单] 1071. Greatest Common Divisor of Strings
- [简单] 1431. Kids With the Greatest Number of Candies
- [简单] 605. Can Place Flowers
- [简单] 345. Reverse Vowels of a String
- [中等] 151. Reverse Words in a String
- [中等] 238. Product of Array Except Self
- [中等] 334. Increasing Triplet Subsequence
- [中等] 443. String Compression
双指针
- [简单] 283. Move Zeroes
- [简单] 392. Is Subsequence
- [中等] 11. Container With Most Water
- [中等] 1679. Max Number of K-Sum Pairs
滑动窗口
- [简单] 643. Maximum Average Subarray I
- [中等] 1456. Maximum Number of Vowels in a Substring of Given Length
- [中等] 1004. Max Consecutive Ones III
- [中等] 1493. Longest Subarray of 1’s After Deleting One Element
前缀和
哈希表
- [简单] 2215. Find the Difference of Two Arrays
- [简单] 1207. Unique Number of Occurrences
- [中等] 1657. Determine if Two Strings Are Close
- [中等] 2352. Equal Row and Column Pairs
栈
队列
- [简单] 933. Number of Recent Calls
- [中等] 649. Dota2 Senate
链表
- [中等] 2095. Delete the Middle Node of a Linked List
- [中等] 328. Odd Even Linked List
- [简单] 206. Reverse Linked List
- [中等] 2130. Maximum Twin Sum of a Linked List
二叉树 - 深度优先搜索
- [简单] 104. Maximum Depth of Binary Tree
- [简单] 872. Leaf-Similar Trees
- [中等] 1448. Count Good Nodes in Binary Tree
- [中等] 437. Path Sum III
- [中等] 1372. Longest ZigZag Path in a Binary Tree
- [中等] 236. Lowest Common Ancestor of a Binary Tree
二叉树 - 广度优先搜索
二叉搜索树
图 - 深度优先搜索
- [中等] 841. Keys and Rooms
- [中等] 547. Number of Provinces
- [中等] 1466. Reorder Routes to Make All Paths Lead to the City Zero
- [中等] 399. Evaluate Division
图 - 广度优先搜索
堆/优先队列
- [中等] 215. Kth Largest Element in an Array
- [中等] 2336. Smallest Number in Infinite Set
- [中等] 2542. Maximum Subsequence Score
- [中等] 2462. Total Cost to Hire K Workers
二分查找
- [简单] 374. Guess Number Higher or Lower
- [中等] 2300. Successful Pairs of Spells and Potions
- [中等] 162. Find Peak Element
- [中等] 875. Koko Eating Bananas
回溯
动态规划 - 一维
- [简单] 1137. N-th Tribonacci Number
- [简单] 746. Min Cost Climbing Stairs
- [中等] 198. House Robber
- [中等] 790. Domino and Tromino Tiling
动态规划 - 多维
- [中等] 62. Unique Paths
- [中等] 1143. Longest Common Subsequence
- [中等] 714. Best Time to Buy and Sell Stock with Transaction Fee
- [中等] 72. Edit Distance