LeetCode - Study Play - LeetCode 75

Ace Coding Interview with 75 Qs

上周(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)。

系列题目整体做下来还是找到很多知识短板的,太久没有做这种题目,很多基本知识甚至是陌生的,抽象算法落到题目场景中的应用也比较生疏,需要提高。 除基本数据结构应用外,其余的树、图、动态规划、堆、二分查找等方面仍需继续提升。

数组/字符串

  1. [简单] 1768. Merge Strings Alternately
  2. [简单] 1071. Greatest Common Divisor of Strings
  3. [简单] 1431. Kids With the Greatest Number of Candies
  4. [简单] 605. Can Place Flowers
  5. [简单] 345. Reverse Vowels of a String
  6. [中等] 151. Reverse Words in a String
  7. [中等] 238. Product of Array Except Self
  8. [中等] 334. Increasing Triplet Subsequence
  9. [中等] 443. String Compression

双指针

  1. [简单] 283. Move Zeroes
  2. [简单] 392. Is Subsequence
  3. [中等] 11. Container With Most Water
  4. [中等] 1679. Max Number of K-Sum Pairs

滑动窗口

  1. [简单] 643. Maximum Average Subarray I
  2. [中等] 1456. Maximum Number of Vowels in a Substring of Given Length
  3. [中等] 1004. Max Consecutive Ones III
  4. [中等] 1493. Longest Subarray of 1’s After Deleting One Element

前缀和

  1. [简单] 1732. Find the Highest Altitude
  2. [简单] 724. Find Pivot Index

哈希表

  1. [简单] 2215. Find the Difference of Two Arrays
  2. [简单] 1207. Unique Number of Occurrences
  3. [中等] 1657. Determine if Two Strings Are Close
  4. [中等] 2352. Equal Row and Column Pairs

  1. [中等] 2390. Removing Stars From a String
  2. [中等] 735. Asteroid Collision
  3. [中等] 394. Decode String

队列

  1. [简单] 933. Number of Recent Calls
  2. [中等] 649. Dota2 Senate

链表

  1. [中等] 2095. Delete the Middle Node of a Linked List
  2. [中等] 328. Odd Even Linked List
  3. [简单] 206. Reverse Linked List
  4. [中等] 2130. Maximum Twin Sum of a Linked List

二叉树 - 深度优先搜索

  1. [简单] 104. Maximum Depth of Binary Tree
  2. [简单] 872. Leaf-Similar Trees
  3. [中等] 1448. Count Good Nodes in Binary Tree
  4. [中等] 437. Path Sum III
  5. [中等] 1372. Longest ZigZag Path in a Binary Tree
  6. [中等] 236. Lowest Common Ancestor of a Binary Tree

二叉树 - 广度优先搜索

  1. [中等] 199. Binary Tree Right Side View
  2. [中等] 1161. Maximum Level Sum of a Binary Tree

二叉搜索树

  1. [简单] 700. Search in a Binary Search Tree
  2. [中等] 450. Delete Node in a BST

图 - 深度优先搜索

  1. [中等] 841. Keys and Rooms
  2. [中等] 547. Number of Provinces
  3. [中等] 1466. Reorder Routes to Make All Paths Lead to the City Zero
  4. [中等] 399. Evaluate Division

图 - 广度优先搜索

  1. [中等] 1926. Nearest Exit from Entrance in Maze
  2. [中等] 994. Rotting Oranges

堆/优先队列

  1. [中等] 215. Kth Largest Element in an Array
  2. [中等] 2336. Smallest Number in Infinite Set
  3. [中等] 2542. Maximum Subsequence Score
  4. [中等] 2462. Total Cost to Hire K Workers

二分查找

  1. [简单] 374. Guess Number Higher or Lower
  2. [中等] 2300. Successful Pairs of Spells and Potions
  3. [中等] 162. Find Peak Element
  4. [中等] 875. Koko Eating Bananas

回溯

  1. [中等] 17. Letter Combinations of a Phone Number
  2. [中等] 216. Combination Sum III

动态规划 - 一维

  1. [简单] 1137. N-th Tribonacci Number
  2. [简单] 746. Min Cost Climbing Stairs
  3. [中等] 198. House Robber
  4. [中等] 790. Domino and Tromino Tiling

动态规划 - 多维

  1. [中等] 62. Unique Paths
  2. [中等] 1143. Longest Common Subsequence
  3. [中等] 714. Best Time to Buy and Sell Stock with Transaction Fee
  4. [中等] 72. Edit Distance

位操作

  1. [简单] 338. Counting Bits
  2. [简单] 136. Single Number
  3. [中等] 1318. Minimum Flips to Make a OR b Equal to c

前缀树

  1. [中等] 208. Implement Trie (Prefix Tree)
  2. [中等] 1268. Search Suggestions System

区间

  1. [中等] 435. Non-overlapping Intervals
  2. [中等] 452. Minimum Number of Arrows to Burst Balloons

单调栈

  1. [中等] 739. Daily Temperatures
  2. [中等] 901. Online Stock Span