面试场景
高频考察问题建模、边界条件与口头表达的清晰度。
常见误区
只背模板不解释为什么,容易在追问里失分。
练习策略
每轮练 3-5 题,固定复盘复杂度和可替代解法。
推荐练习顺序
题库
矩阵 题库
先展示一段最适合快速浏览的题目列表,继续滚动时再慢慢续载,避免专题页被长列表一下子拉穿。
慢加载专题题库
适合这类题很多的专题,先扫结构,再逐步深入。
当前展示 24 / 221 道题目
每次续载 24 题有效的数独
Check if a 9x9 Sudoku board is valid by scanning rows, columns, and sub-boxes with hash lookups, ensuring no duplicates …
解数独
Solve the Sudoku puzzle by filling empty cells while respecting Sudoku's rules using array scanning and backtracking.
旋转图像
Rotate an n x n matrix 90 degrees clockwise in-place using array manipulation and mathematical indexing techniques effic…
螺旋矩阵
Given an m x n matrix, return all elements in spiral order starting from the top-left corner.
螺旋矩阵 II
Generate a spiral matrix of size n x n, filled with elements from 1 to n² in spiral order, for interview-focused solving…
不同路径 II
Calculate the number of unique paths from top-left to bottom-right in a grid with obstacles using dynamic programming st…
最小路径和
Compute the minimum sum from top-left to bottom-right in a grid using state transition dynamic programming efficiently.
矩阵置零
Modify the matrix in place by setting rows and columns to zero when an element is zero.
搜索二维矩阵
Search a 2D matrix efficiently using binary search over its linearized index, ensuring correctness in row-major sorted a…
单词搜索
Solve Word Search with backtracking by exploring adjacent cells to match a target word in a grid.
最大矩形
Compute the largest rectangle of 1's in a binary matrix using dynamic programming and stack-based state transitions effi…
被围绕的区域
Transform the matrix in-place by marking regions surrounded by 'X' as 'X', while keeping border-adjacent 'O's intact.
地下城游戏
Calculate the minimum initial health the knight needs to survive the dungeon using state transition dynamic programming …
岛屿数量
Count the number of distinct islands in a binary grid using array traversal combined with depth-first search exploration…
单词搜索 II
Solve the Word Search II problem using backtracking with pruning to find all words on a board of characters.
最大正方形
Maximal Square is a matrix-based dynamic programming problem that focuses on finding the largest square filled with 1's.
搜索二维矩阵 II
Efficiently search for a target in a 2D matrix using binary search and matrix properties.
生命游戏
Solve the Game of Life by updating each cell based on its eight neighbors using Array and Matrix simulation patterns eff…
二维区域和检索 - 矩阵不可变
Design a 2D matrix class that efficiently handles sum queries with O(1) time complexity using a prefix sum approach.
矩阵中的最长递增路径
Find the length of the longest increasing path in a matrix with given movement constraints using graph techniques.
矩形区域不超过 K 的最大数值和
Solve the "Max Sum of Rectangle No Larger Than K" problem using binary search over the valid sum space to optimize space…
有序矩阵中第 K 小的元素
Find the kth smallest element in a sorted n x n matrix using efficient binary search or heap strategies for optimized me…
接雨水 II
Solve Trapping Rain Water II using breadth-first search and priority queues for efficient water trapping in a matrix.
太平洋大西洋水流问题
Find all cells on an island where water can flow to both the Pacific and Atlantic oceans using DFS or BFS.
swap_vert在题库框内继续向下滚动,也会自动续载