题库chevron_right分类chevron_right数组
list

数组

1672 道题目
简单: 363中等: 876困难: 433

数组 是技术面试里最常出现的能力维度之一。建议先掌握基础题型的边界处理,再逐步过渡到模式识别和复杂度 trade-off。

面试场景

高频考察问题建模、边界条件与口头表达的清晰度。

常见误区

只背模板不解释为什么,容易在追问里失分。

练习策略

每轮练 3-5 题,固定复盘复杂度和可替代解法。

推荐练习顺序

#题目难度
1

两数之和

Two Sum is solved fastest by storing seen values in a hash map and checking each number's needed complement once.

简单
4

寻找两个正序数组的中位数

Find the median of two sorted arrays using binary search for efficient O(log(min(m, n))) time complexity.

困难
11

盛最多水的容器

Find two vertical lines that can form a container with the most water in a given array of heights.

中等
14

最长公共前缀

Find the longest common prefix in an array of strings, returning an empty string if none exists.

简单
15

三数之和

Given an integer array, return all unique triplets where the sum is zero using two-pointer scanning with careful duplica…

中等
16

最接近的三数之和

Find the sum of three integers in an array that is closest to a given target using two-pointer scanning.

中等
18

四数之和

The 4Sum problem requires finding all unique quadruplets in an array that sum to a specific target value.

中等
26

删除有序数组中的重复项

Learn how to remove duplicates from a sorted array in-place using two-pointer scanning while preserving element order.

简单
27

移除元素

Remove Element challenges you to remove a value from an array in-place using efficient two-pointer scanning and tracking…

简单
31

下一个排列

Next Permutation is a medium-difficulty problem focusing on generating the next lexicographically greater permutation of…

中等
33

搜索旋转排序数组

Find the index of a target in a rotated sorted array using a careful binary search that handles pivot shifts.

中等
34

在排序数组中查找元素的第一个和最后一个位置

Locate the first and last index of a target in a sorted array using binary search for precise O(log n) performance.

中等
35

搜索插入位置

Find the correct index for a target value in a sorted array using binary search, or return the position where it should …

简单
36

有效的数独

Check if a 9x9 Sudoku board is valid by scanning rows, columns, and sub-boxes with hash lookups, ensuring no duplicates …

中等
37

解数独

Solve the Sudoku puzzle by filling empty cells while respecting Sudoku's rules using array scanning and backtracking.

困难
39

组合总和

Find all unique combinations of numbers from a distinct array that sum to a target using controlled backtracking search.

中等
40

组合总和 II

Find all unique combinations of numbers that sum to a target using backtracking with careful pruning to avoid duplicates…

中等
41

缺失的第一个正数

Identify the smallest missing positive integer in an unsorted array using constant space and linear time scanning techni…

困难
42

接雨水

Calculate the total trapped rain water using the elevation map array, leveraging dynamic programming and two-pointer pat…

困难
45

跳跃游戏 II

Jump Game II requires finding the minimum jumps to reach the end of an array using dynamic programming and greedy techni…

中等
46

全排列

Generate all possible orderings of a distinct integer array using backtracking search with careful pruning to avoid dupl…

中等
47

全排列 II

Generate all unique permutations of an array containing duplicates using backtracking and pruning to avoid repeated sequ…

中等
48

旋转图像

Rotate an n x n matrix 90 degrees clockwise in-place using array manipulation and mathematical indexing techniques effic…

中等
49

字母异位词分组

Group the anagrams in a list of strings using efficient hash table-based methods, focusing on array scanning.

中等
51

N 皇后

Solve the N-Queens problem using backtracking with pruning, exploring all valid board placements while avoiding conflict…

困难
53

最大子数组和

Maximum Subarray is a classic state transition dynamic programming problem about deciding whether to extend or restart a…

中等
54

螺旋矩阵

Given an m x n matrix, return all elements in spiral order starting from the top-left corner.

中等
55

跳跃游戏

Solve the Jump Game problem using state transition dynamic programming to determine if you can reach the last index of t…

中等
56

合并区间

Merge Intervals requires sorting an array of interval pairs and combining overlaps efficiently using sequential comparis…

中等
57

插入区间

Given a sorted array of non-overlapping intervals, insert a new interval and merge any overlapping intervals.

中等
59

螺旋矩阵 II

Generate a spiral matrix of size n x n, filled with elements from 1 to n² in spiral order, for interview-focused solving…

中等
63

不同路径 II

Calculate the number of unique paths from top-left to bottom-right in a grid with obstacles using dynamic programming st…

中等
64

最小路径和

Compute the minimum sum from top-left to bottom-right in a grid using state transition dynamic programming efficiently.

中等
66

加一

Given a number as an array of digits, increment it by one and return the updated array of digits.

简单
68

文本左右对齐

Text Justification requires packing words into lines to match a specified width, ensuring even distribution of spaces.

困难
73

矩阵置零

Modify the matrix in place by setting rows and columns to zero when an element is zero.

中等
74

搜索二维矩阵

Search a 2D matrix efficiently using binary search over its linearized index, ensuring correctness in row-major sorted a…

中等
75

颜色分类

Sort Colors requires in-place reordering of an array using a two-pointer scanning strategy to group 0s, 1s, and 2s effic…

中等
78

子集

Generate all subsets of a set of unique integers using backtracking with pruning to avoid duplicates.

中等
79

单词搜索

Solve Word Search with backtracking by exploring adjacent cells to match a target word in a grid.

中等
80

删除有序数组中的重复项 II

Solve the problem of removing duplicates from a sorted array in-place, ensuring each element appears at most twice, usin…

中等
81

搜索旋转排序数组 II

Determine if a target exists in a rotated sorted array that may contain duplicates using a binary search variation effic…

中等
84

柱状图中最大的矩形

Find the maximal rectangular area in a histogram using stack-based state management for precise bar tracking and width c…

困难
85

最大矩形

Compute the largest rectangle of 1's in a binary matrix using dynamic programming and stack-based state transitions effi…

困难
88

合并两个有序数组

Merge two sorted arrays into the first array in non-decreasing order, using a two-pointer approach.

简单
90

子集 II

Subsets II problem asks to generate unique subsets from an array with possible duplicates using backtracking search with…

中等
105

从前序与中序遍历序列构造二叉树

Construct a binary tree using preorder and inorder traversal arrays, leveraging array scanning and hash table lookups.

中等
106

从中序与后序遍历序列构造二叉树

Reconstruct a binary tree from given inorder and postorder arrays using array scanning and hash lookup to optimize recur…

中等
108

将有序数组转换为二叉搜索树

Pick the middle element as root at each step so the sorted array becomes a height-balanced BST with valid ordering.

简单
118

杨辉三角

Generate the first numRows of Pascal's Triangle using dynamic programming with clear state transitions and array manipul…

简单
119

杨辉三角 II

Compute the specific row of Pascal's Triangle using efficient state transition dynamic programming with array-based upda…

简单
120

三角形最小路径和

Given a triangle, return the minimum path sum from top to bottom, moving to adjacent numbers in the row below.

中等
121

买卖股票的最佳时机

Maximize stock profit by identifying the optimal buy and sell days using dynamic programming.

简单
122

买卖股票的最佳时机 II

Maximize stock profit by using a greedy approach to buy and sell multiple times, with state transition dynamic programmi…

中等
123

买卖股票的最佳时机 III

Determine the maximum profit from at most two stock transactions using state transition dynamic programming on price arr…

困难
128

最长连续序列

Find the length of the longest consecutive elements sequence in an unsorted array using array scanning and hash lookup.

中等
130

被围绕的区域

Transform the matrix in-place by marking regions surrounded by 'X' as 'X', while keeping border-adjacent 'O's intact.

中等
134

加油站

The Gas Station problem requires finding the starting station index for a full circular trip with gas stations and costs…

中等
135

分发糖果

The Candy problem is a greedy algorithm challenge where you need to minimize candy distribution while satisfying certain…

困难
136

只出现一次的数字

Solve the Single Number problem using an efficient approach with constant space and linear time complexity.

简单
137

只出现一次的数字 II

Find the single element in an array where every other element appears three times, using bit manipulation and constant s…

中等
139

单词拆分

Determine if a string can be fully segmented into dictionary words using array scanning and hash-based lookups for effic…

中等
140

单词拆分 II

Given a string and dictionary, return all possible sentences by adding spaces where each word is in the dictionary.

困难
149

直线上最多的点数

Find the maximum number of points on a straight line in a 2D plane using array scanning and hash lookup.

困难
150

逆波兰表达式求值

Compute the result of an arithmetic expression in Reverse Polish Notation using a stack to manage operands efficiently.

中等
152

乘积最大子数组

Find the subarray with the largest product in an integer array using dynamic programming techniques.

中等
153

寻找旋转排序数组中的最小值

Find the minimum element in a rotated sorted array using binary search to efficiently identify the point of rotation.

中等
154

寻找旋转排序数组中的最小值 II

Find the minimum in a rotated sorted array with possible duplicates using binary search.

困难
162

寻找峰值

Find Peak Element leverages binary search for efficiently locating a peak in an array, a problem commonly asked in techn…

中等
164

最大间距

Find the largest difference between successive elements in a sorted array efficiently using linear time techniques and b…

中等
167

两数之和 II - 输入有序数组

Solve the Two Sum II problem efficiently using binary search over a valid answer space in a sorted array.

中等
169

多数元素

Find the majority element in an array, where the element appears more than n/2 times, using efficient algorithms.

简单
174

地下城游戏

Calculate the minimum initial health the knight needs to survive the dungeon using state transition dynamic programming …

困难
179

最大数

The problem asks to arrange integers to form the largest possible number, focusing on greedy algorithms and string handl…

中等
188

买卖股票的最佳时机 IV

Determine the maximum profit from at most k stock transactions using state transition dynamic programming on an array of…

困难
189

轮转数组

Rotate Array challenges you to shift elements right by k steps using precise two-pointer scanning and invariant tracking…

中等
198

打家劫舍

Maximize the amount of money you can rob tonight without alerting the police by applying dynamic programming with state …

中等
200

岛屿数量

Count the number of distinct islands in a binary grid using array traversal combined with depth-first search exploration…

中等
204

计数质数

Count all prime numbers less than a given integer n using efficient array and math-based enumeration techniques.

中等
209

长度最小的子数组

Find the minimal length of a subarray whose sum is greater than or equal to the target using efficient algorithms.

中等
212

单词搜索 II

Solve the Word Search II problem using backtracking with pruning to find all words on a board of characters.

困难
213

打家劫舍 II

Maximize your loot by robbing houses arranged in a circle without alerting the police using dynamic programming.

中等
215

数组中的第K个最大元素

Find the kth largest element in an unsorted array using optimal approaches like Quickselect or heaps.

中等
216

组合总和 III

Find all unique combinations of k numbers adding to n using efficient backtracking with pruning in arrays.

中等
217

存在重复元素

Determine if an integer array contains any duplicate values by efficiently scanning with a hash lookup to ensure fast de…

简单
218

天际线问题

The Skyline Problem requires calculating a city's silhouette using array manipulation and divide-and-conquer techniques …

困难
219

存在重复元素 II

Check if any two equal numbers exist within k indices using array scanning and hash table lookup efficiently.

简单
220

存在重复元素 III

The problem involves finding a pair of indices in an array where the index and value differences are within given limits…

困难
221

最大正方形

Maximal Square is a matrix-based dynamic programming problem that focuses on finding the largest square filled with 1's.

中等
228

汇总区间

Summary Ranges involves converting a sorted array of unique integers into a minimal list of range strings.

简单
229

多数元素 II

Identify all elements in an integer array appearing more than ⌊ n/3 ⌋ times using efficient array scanning and hash coun…

中等
238

除了自身以外数组的乘积

Solve the 'Product of Array Except Self' problem by calculating the product of all elements except self for each index e…

中等
239

滑动窗口最大值

Solve the "Sliding Window Maximum" problem using efficient techniques like the sliding window, deque, and priority queue…

困难
240

搜索二维矩阵 II

Efficiently search for a target in a 2D matrix using binary search and matrix properties.

中等
260

只出现一次的数字 III

Find the two unique numbers in an array where all other numbers appear exactly twice using bit manipulation efficiently.

中等
268

丢失的数字

Find the missing number in an array containing distinct numbers in the range [0, n].

简单
274

H 指数

Determine a researcher's h-index by analyzing citations using array sorting and counting techniques efficiently and accu…

中等
275

H 指数 II

Compute a researcher's H-Index from a sorted citation array using binary search over the valid answer space efficiently.

中等
283

移动零

Move all zeros in an array to the end while preserving the order of non-zero elements using efficient in-place operation…

简单
284

窥视迭代器

Design an iterator with peek functionality, adding to the standard next and hasNext operations for efficient element acc…

中等
287

寻找重复数

The problem involves finding the duplicate number in an array of integers, using a binary search approach over the valid…

中等
289

生命游戏

Solve the Game of Life by updating each cell based on its eight neighbors using Array and Matrix simulation patterns eff…

中等
300

最长递增子序列

Solve the Longest Increasing Subsequence problem using dynamic programming and binary search to efficiently find the sub…

中等
303

区域和检索 - 数组不可变

The Range Sum Query - Immutable problem involves implementing a data structure to handle range sum queries efficiently.

简单
304

二维区域和检索 - 矩阵不可变

Design a 2D matrix class that efficiently handles sum queries with O(1) time complexity using a prefix sum approach.

中等
307

区域和检索 - 数组可修改

Implement a mutable range sum query using efficient design patterns to handle multiple updates and range sum queries.

中等
309

买卖股票的最佳时机含冷冻期

Maximize stock profit with cooldown restrictions using state transition dynamic programming to track buy, sell, and cool…

中等
312

戳气球

Burst Balloons is a hard dynamic programming problem requiring careful state transitions to maximize coins collected eff…

困难
313

超级丑数

Compute the nth super ugly number efficiently using dynamic programming with state transitions based on the given prime …

中等
315

计算右侧小于当前元素的个数

Solve the Count of Smaller Numbers After Self problem using binary search and optimized algorithms.

困难
318

最大单词长度乘积

The problem requires finding the maximum product of lengths of two words from an array, where the words don't share comm…

中等
321

拼接最大数

Create Maximum Number involves merging digits from two arrays while preserving order, maximizing the resulting number.

困难
322

零钱兑换

Find the minimum number of coins needed to reach a target amount using dynamic programming state transitions efficiently…

中等
324

摆动排序 II

Rearrange an array in a way that every odd-indexed element is greater than its adjacent even-indexed elements.

中等
327

区间和的个数

Count the number of subarray sums within a given inclusive range using optimized divide-and-conquer techniques efficient…

困难
329

矩阵中的最长递增路径

Find the length of the longest increasing path in a matrix with given movement constraints using graph techniques.

困难
330

按要求补齐数组

Patching Array requires adding the minimum numbers to cover all sums from 1 to n using greedy choices and invariant chec…

困难
334

递增的三元子序列

Identify if an array contains a strictly increasing triplet by maintaining a running minimal and middle value efficientl…

中等
335

路径交叉

Determine if a path defined by sequential distances on a 2D plane crosses itself using array and math reasoning.

困难
336

回文对

Find all pairs of words in a list that form palindromes when concatenated using efficient scanning and hash mapping.

困难
347

前 K 个高频元素

Find the k most frequent elements from an array using efficient algorithms like hashing and sorting.

中等
349

两个数组的交集

Find the intersection of two arrays while ensuring unique elements using efficient array scanning and hash lookups.

简单
350

两个数组的交集 II

Find the intersection of two arrays, accounting for multiple occurrences of the same number.

简单
354

俄罗斯套娃信封问题

Russian Doll Envelopes is a dynamic programming problem that involves finding the longest chain of envelopes that can be…

困难
363

矩形区域不超过 K 的最大数值和

Solve the "Max Sum of Rectangle No Larger Than K" problem using binary search over the valid sum space to optimize space…

困难
368

最大整除子集

Find the largest subset of distinct positive integers where every pair satisfies divisibility using state transition dyn…

中等
373

查找和最小的 K 对数字

Find K Pairs with Smallest Sums combines arrays and heap usage to select the smallest sum pairs efficiently.

中等
376

摆动序列

Find the longest wiggle subsequence in an integer array using state transition dynamic programming with greedy optimizat…

中等
377

组合总和 Ⅳ

Combination Sum IV asks to find the number of combinations that sum to a given target using elements from an array.

中等
378

有序矩阵中第 K 小的元素

Find the kth smallest element in a sorted n x n matrix using efficient binary search or heap strategies for optimized me…

中等
380

O(1) 时间插入、删除和获取随机元素

Implement a data structure supporting insert, delete, and getRandom in average O(1) using array plus hash mapping.

中等
381

O(1) 时间插入、删除和获取随机元素 - 允许重复

This problem challenges you to design a data structure that supports insertion, removal, and random access with O(1) tim…

困难
384

打乱数组

Shuffle an Array requires designing a class to randomly permute an integer array while ensuring all permutations are equ…

中等
391

完美矩形

Determine if given axis-aligned rectangles form a perfect cover using array scanning and hash-based corner counting tech…

困难
393

UTF-8 编码验证

Determine if an integer array represents valid UTF-8 encoding based on its byte sequences using bit manipulation.

中等
396

旋转函数

Maximize the rotation function by rotating the array and calculating the weighted sum for all rotations.

中等
399

除法求值

Compute the results of division queries from given equations using graph traversal and depth-first search efficiently.

中等
403

青蛙过河

Determine if a frog can cross a river using jumps constrained by previous step sizes in a dynamic programming state tran…

困难
406

根据身高重建队列

Reconstruct a queue based on the given heights and the number of taller people in front, using sorting and binary indexe…

中等
407

接雨水 II

Solve Trapping Rain Water II using breadth-first search and priority queues for efficient water trapping in a matrix.

困难
410

分割数组的最大值

Solve the 'Split Array Largest Sum' problem by minimizing the largest sum across k subarrays using dynamic programming a…

困难
413

等差数列划分

Count the number of arithmetic subarrays in a given integer array using dynamic programming.

中等
414

第三大的数

Find the third distinct maximum number in an array using array traversal and sorting techniques, handling duplicates car…

简单
416

分割等和子集

Determine if an array can be partitioned into two subsets with equal sum using dynamic programming techniques.

中等
417

太平洋大西洋水流问题

Find all cells on an island where water can flow to both the Pacific and Atlantic oceans using DFS or BFS.

中等
419

棋盘上的战舰

Count the number of non-overlapping battleships on a 2D board using array traversal and depth-first search patterns effi…

中等
421

数组中两个数的最大异或值

Find the maximum XOR of two numbers in an integer array using efficient bit manipulation techniques.

中等
427

建立四叉树

Construct a Quad-Tree from a binary matrix by recursively subdividing regions and tracking uniform states efficiently.

中等
435

无重叠区间

Determine the minimum number of intervals to remove from a list to ensure no intervals overlap using dynamic programming…

中等
442

数组中重复的数据

Find all integers that appear twice in an array with O(n) time and constant space complexity.

中等
446

等差数列划分 II - 子序列

Count all arithmetic subsequences in an array using dynamic programming with precise state transitions for correctness.

困难
447

回旋镖的数量

Compute all valid boomerang tuples in a point set using array scanning with hash maps to track distances efficiently.

中等
448

找到所有数组中消失的数字

Identify all missing numbers in an array using efficient scanning and hash-based lookup for optimal performance.

简单
452

用最少数量的箭引爆气球

Find the minimum number of arrows needed to burst all balloons by considering greedy choice and invariant validation.

中等
453

最小操作次数使数组元素相等

Compute the fewest steps to make all elements equal by incrementing n-1 array items, applying array and math reasoning.

中等
454

四数相加 II

Count all quadruples from four integer arrays that sum to zero using efficient array scanning and hash table lookups.

中等
455

分发饼干

Maximize content children by assigning at most one cookie per child using two-pointer scanning and greedy sorting techni…

简单
456

132 模式

Identify whether a given integer array contains a 132 pattern subsequence using efficient stack and search techniques.

中等
457

环形数组是否存在循环

Detect whether a circular array contains a loop of consistent direction using efficient array scanning and hash lookup t…

中等
462

最小操作次数使数组元素相等 II

Find the minimum moves to equalize all array elements using increments or decrements with array and math techniques.

中等
463

岛屿的周长

Determine the perimeter of an island in a grid of land and water cells using DFS or BFS.

简单
472

连接词

Find concatenated words by using dynamic programming and depth-first search to identify valid words made of other words …

困难
473

火柴拼正方形

The problem asks to determine if we can use matchsticks to form a square, exploring dynamic programming and backtracking…

中等
474

一和零

Solve the Ones and Zeroes problem using dynamic programming with state transition, focusing on array and string manipula…

中等
475

供暖器

Determine the minimum heater radius to cover all houses using a binary search over potential radius values efficiently.

中等
477

汉明距离总和

Calculate the total Hamming distance between all pairs in an integer array using efficient bit manipulation techniques.

中等
480

滑动窗口中位数

Compute the median for each sliding window of size k in an array using efficient array scanning and hash lookup techniqu…

困难
485

最大连续 1 的个数

Find the maximum sequence of consecutive 1s in a binary array using an efficient array-driven scanning approach.

简单
486

预测赢家

Predict the Winner involves two players taking turns to maximize their score by picking from either end of an array, opt…

中等
491

非递减子序列

Return all possible non-decreasing subsequences with at least two elements from the input array, nums.

中等
493

翻转对

Count the number of reverse pairs in a given integer array using efficient algorithms like binary search and merge sort.

困难
494

目标和

Target Sum requires counting all expressions from nums using '+' or '-' that evaluate exactly to the given target intege…

中等
495

提莫攻击

Compute the total poisoned time Ashe experiences from Teemo's attacks using an array-based simulation approach efficient…

简单
496

下一个更大元素 I

Find the next greater element for each number in nums1 from the nums2 array using an optimized approach.

简单
497

非重叠矩形中的随机点

Design an algorithm to pick random points within non-overlapping rectangles using binary search and reservoir sampling.

中等
498

对角线遍历

Traverse a matrix diagonally and return all elements in the specific zig-zag order required by the problem pattern.

中等
500

键盘行

Identify all words from a list that can be typed using letters from only one row of a standard American keyboard.

简单
502

IPO

Maximize total capital by selecting up to k projects, based on initial capital and project profits using a greedy strate…

困难
503

下一个更大元素 II

Solve the Next Greater Element II problem by using a stack-based state management approach for circular arrays.

中等
506

相对名次

Solve Relative Ranks by sorting scores with original indices, then writing medal labels or numeric places back in answer…

简单
517

超级洗衣机

Calculate the minimum moves to balance dresses across washing machines using a greedy strategy and invariant validation …

困难
518

零钱兑换 II

Calculate the number of unique coin combinations to reach a target amount using state transition dynamic programming eff…

中等
522

最长特殊序列 II

Find the longest string in an array that is not a subsequence of any other string, using array scanning and hash checks …

中等
523

连续的子数组和

Identify if any continuous subarray sums to a multiple of k using prefix sums and hash table tracking efficiently.

中等
524

通过删除字母匹配到字典里最长单词

Find the longest word in the dictionary that can be formed by deleting characters from a string, using two-pointer scann…

中等
525

连续数组

Find the maximum length contiguous subarray with equal numbers of 0s and 1s using array scanning and hash lookup efficie…

中等
526

优美的排列

The Beautiful Arrangement problem asks for the number of valid permutations of n integers satisfying specific divisibili…

中等
528

按权重随机选择

Random Pick with Weight requires implementing a probabilistic index picker using prefix sums and binary search efficient…

中等
529

扫雷游戏

Solve the Minesweeper game by updating revealed squares and handling clicks with Depth-First Search and Array manipulati…

中等
532

数组中的 k-diff 数对

Solve K-diff Pairs in an Array by counting unique differences with a hash map or sorted two-pointer sweep.

中等
539

最小时间差

Calculate the smallest time difference between clock points using array manipulation and mathematical conversions effici…

中等
540

有序数组中的单一元素

Find the single non-duplicate element in a sorted array where every other element appears exactly twice.

中等
542

01 矩阵

The '01 Matrix' problem challenges you to find the nearest zero for each cell in a binary matrix using dynamic programmi…

中等
546

移除盒子

Maximize points by strategically removing contiguous same-colored boxes using state transition dynamic programming and m…

困难
553

最优除法

Maximize the value of an expression by optimally placing parentheses for division operations.

中等
554

砖墙

Solve the Brick Wall problem using array scanning and hash lookups to minimize crossed bricks from a vertical line.

中等
560

和为 K 的子数组

Count the total number of contiguous subarrays in an integer array that sum exactly to a target value k using optimized …

中等
561

数组拆分

Maximize the sum of minimums of n pairs in a 2n integer array using a greedy pairing strategy efficiently.

简单
565

数组嵌套

Find the longest nested set in a permutation array using a depth-first traversal, handling cycles efficiently for medium…

中等
566

重塑矩阵

Reshape the Matrix involves transforming a 2D matrix into a new matrix with the same elements in row-major order, follow…

简单
575

分糖果

Maximize the number of different candies Alice can eat given a set of candies and constraints on quantity.

简单
581

最短无序连续子数组

Find the shortest unsorted continuous subarray that, if sorted, would sort the entire array.

中等
587

安装栅栏

Find the perimeter fence of a garden by determining the outermost trees in a set of given tree coordinates.

困难
594

最长和谐子序列

Find the length of the longest harmonious subsequence in an integer array using array scanning and hash-based frequency …

简单
598

区间加法 II

Range Addition II requires counting maximum values in a matrix after incremental operations using array and math reasoni…

简单
599

两个列表的最小索引总和

Find the common strings between two lists with the smallest index sum in this easy problem involving array scanning and …

简单
605

种花问题

Determine if n new flowers can be planted in a flowerbed, ensuring no adjacent flowers using a greedy approach.

简单
609

在系统中查找重复文件

Find and return duplicate files in the file system, grouping them by their paths and contents using an array scanning ap…

中等
611

有效三角形的个数

Count all triplets in an integer array that satisfy the triangle inequality to form valid triangles efficiently using so…

中等
621

任务调度器

Task Scheduler is solved by counting task frequencies and computing how cooldown gaps force idle slots around the most f…

中等
622

设计循环队列

Design a circular queue that allows efficient FIFO operations using linked-list pointer manipulation to optimize space u…

中等
624

数组列表中的最大距离

Maximum Distance in Arrays uses a greedy running minimum and maximum from previous arrays to validate cross array distan…

中等
628

三个数的最大乘积

Find three numbers in an array whose product is the largest using sorting and careful handling of negative values.

简单
630

课程表 III

Solve the 'Course Schedule III' problem with a greedy approach involving course selection and validation of constraints.

困难
632

最小区间

Find the minimal range covering at least one number from each of k sorted lists using array scanning and hash lookup eff…

困难
636

函数的独占时间

Solve the 'Exclusive Time of Functions' problem using stack-based state management for accurate function execution time …

中等
638

大礼包

Minimize the cost of purchasing items using available special offers with state transition dynamic programming.

中等
641

设计循环双端队列

Design and implement a circular deque using linked-list pointer manipulation, ensuring efficient insertion and deletion …

中等
643

子数组最大平均数 I

Find the maximum average of any contiguous subarray of length k in a given integer array using a sliding window approach…

简单
645

错误的集合

Identify the duplicated and missing numbers in an integer array using array scanning combined with hash table lookup eff…

简单
646

最长数对链

Determine the maximum length of a chain formed by pairs using dynamic programming and greedy sorting techniques efficien…

中等
648

单词替换

Replace words in a sentence using the shortest root from a dictionary, applying efficient array scanning and hash lookup…

中等
654

最大二叉树

Construct a maximum binary tree by recursively selecting the largest element and dividing the array into left and right …

中等
658

找到 K 个最接近的元素

Identify the k integers closest to a target x in a sorted array using binary search and two-pointer strategies efficient…

中等
659

分割数组为连续子序列

Verify if it's possible to split a sorted array into consecutive subsequences of length 3 or more.

中等
661

图片平滑器

Apply a 3x3 smoothing filter to a matrix, rounding down each cell average including surrounding neighbors for accurate r…

简单
665

非递减数列

Check if an array can become non-decreasing by modifying at most one element using an array-driven solution strategy.

中等
667

优美的排列 II

Construct a beautiful arrangement of integers from 1 to n with k distinct integers, optimizing for time and space effici…

中等
673

最长递增子序列的个数

This problem challenges you to find the number of longest increasing subsequences in a given array of integers.

中等
674

最长连续递增序列

Find the length of the longest continuous increasing subsequence in an unsorted integer array using an array-driven solu…

简单
675

为高尔夫比赛砍树

Determine the minimum steps to cut all trees in a forest matrix in ascending height order using BFS traversal and priori…

困难
679

24 点游戏

Solve the 24 Game by arranging four card numbers using arithmetic operators and parentheses to reach exactly 24 efficien…

困难
682

棒球比赛

Simulate baseball score operations using a stack-based approach to compute the final score after all operations.

简单
689

三个无重叠子数组的最大和

Maximize the sum of three non-overlapping subarrays with length k in an integer array using dynamic programming.

困难
690

员工的重要性

Calculate an employee's total importance including all direct and indirect subordinates using array scanning and hash lo…

中等
691

贴纸拼词

Determine the minimum number of stickers needed to spell a target word using array scanning and hash lookups for efficie…

困难
692

前K个高频单词

Solve Top K Frequent Words by counting each word, then ordering ties alphabetically so frequency wins before lexicograph…

中等
695

岛屿的最大面积

Find the largest connected land area in a binary grid using array traversal and depth-first search efficiently.

中等
697

数组的度

Find the shortest subarray with the same degree as the given array using efficient array scanning and hash lookups.

简单
698

划分为k个相等的子集

Determine if an integer array can be partitioned into k subsets where each subset sums to the same value using DP and ba…

中等
699

掉落的方块

Solve Falling Squares by efficiently computing maximum stack heights using arrays with segment tree optimization techniq…

困难
704

二分查找

Solve the Binary Search problem by finding the index of a target value in a sorted array with O(log n) complexity.

简单
705

设计哈希集合

Implement a custom HashSet without built-in libraries using array scanning and hash lookup for efficient membership chec…

简单
706

设计哈希映射

Implement a custom HashMap from scratch using array scanning and hash lookup without built-in libraries for efficient ke…

简单
710

黑名单中的随机数

Random Pick with Blacklist requires designing a method to uniformly pick integers while excluding blacklisted values eff…

困难
713

乘积小于 K 的子数组

Count subarrays with a product strictly less than a given value k using efficient algorithms like binary search and slid…

中等
714

买卖股票的最佳时机含手续费

Maximize stock trading profits accounting for per-transaction fees using state transition dynamic programming and greedy…

中等
717

1 比特与 2 比特字符

Determine whether the last character in a binary array represents a one-bit character or a two-bit character.

简单
718

最长重复子数组

Find the maximum length of a subarray that appears in both given integer arrays using dynamic programming.

中等
719

找出第 K 小的数对距离

Solve Find K-th Smallest Pair Distance by sorting nums, then binary searching the distance and counting valid pairs with…

困难
720

词典中最长的单词

Find the longest word in a dictionary that can be built one character at a time from other words in the dictionary.

中等
721

账户合并

Merge accounts by connecting emails and returning each user's sorted email list using array scanning and hash lookup eff…

中等
722

删除注释

Remove comments from a given C++ program source array, handling line and block comments.

中等
724

寻找数组的中心下标

Find the pivot index in an array where the sums of elements on both sides are equal using array and prefix sum technique…

简单
729

我的日程安排表 I

Implement a calendar supporting non-overlapping event bookings using binary search for efficient insertion and conflict …

中等
731

我的日程安排表 II

Implement a calendar that allows double bookings but prevents triple bookings, managing overlapping intervals efficientl…

中等
733

图像渲染

Flood Fill is an array and DFS problem where you change connected pixels to a target color efficiently using recursion o…

简单
735

小行星碰撞

Determine the final positions of moving asteroids using a stack-based simulation for efficient collision resolution in l…

中等
739

每日温度

In the Daily Temperatures problem, you need to find out how many days to wait for a warmer temperature based on given da…

中等
740

删除并获得点数

Maximize points by deleting numbers from an array while removing all adjacent values, using dynamic programming efficien…

中等
741

摘樱桃

Maximize cherries collected on a grid, employing state transition dynamic programming with careful navigation across obs…

困难
744

寻找比目标字母大的最小字母

Locate the smallest character in a sorted array that is strictly greater than a given target using efficient binary sear…

简单
745

前缀和后缀搜索

Design a dictionary to search words by both prefix and suffix using a Trie structure and hash lookups.

困难
746

使用最小花费爬楼梯

Compute the minimum cost to reach the top of a staircase using dynamic programming and step-by-step state transitions ef…

简单
747

至少是其他数字两倍的最大数

Determine if the largest number in the array is at least twice as large as every other element, and return its index or …

简单
748

最短补全词

Find the shortest word that completes the license plate by matching all required letters, considering frequency and case…

简单
749

隔离病毒

Contain Virus involves using array-based Depth-First Search to contain viral spread by building walls around infected re…

困难
752

打开转盘锁

Solve the Open the Lock problem using array scanning plus hash lookup to efficiently find the shortest unlock sequence.

中等
757

设置交集大小至少为2

Solve the Set Intersection Size At Least Two problem using a greedy approach and invariant validation.

困难
764

最大加号标志

Find the largest axis-aligned plus sign in a binary grid with some mines using dynamic programming.

中等
766

托普利茨矩阵

Determine if a given matrix is a Toeplitz matrix by checking diagonal consistency.

简单
768

最多能完成排序的块 II

Determine the maximum number of chunks you can split an array into so that sorting each chunk results in a fully sorted …

困难
769

最多能完成排序的块

The Max Chunks To Make Sorted problem requires you to split an array into the maximum number of chunks that can be sorte…

中等
773

滑动谜题

Determine the minimum moves to solve a 2x3 sliding puzzle using BFS and state transition dynamic programming techniques …

困难
775

全局倒置与局部倒置

Determine if every global inversion in a permutation array is also a local inversion using array and math logic efficien…

中等
778

水位上升的泳池中游泳

Solve the problem of swimming through a grid of rising water with a binary search on the valid answer space.

困难
781

森林中的兔子

Solve Rabbits in Forest by grouping equal answers and rounding each group into the smallest valid color-class size.

中等
782

变为棋盘

Determine the minimum swaps of rows or columns to convert an n x n binary board into a valid chessboard configuration.

困难
786

第 K 个最小的质数分数

Find the k-th smallest fraction from a sorted array of unique primes using a binary search over the answer space.

中等
789

逃脱阻碍者

Escape The Ghosts tests your ability to analyze movements in an infinite grid while racing against ghost positions using…

中等
792

匹配子序列的单词数

Given a string s and a list of words, count how many words are subsequences of s using efficient array scanning and hash…

中等
794

有效的井字游戏

Verify if a given Tic-Tac-Toe board can represent a valid game state during a valid sequence of moves.

中等
795

区间子数组个数

Count the number of contiguous subarrays with a bounded maximum value using a two-pointer approach.

中等
798

得分最高的最小轮调

Find the smallest rotation index with the highest score using array and prefix sum techniques.

困难
801

使序列递增的最小交换次数

This problem involves finding the minimum number of swaps needed to make two sequences strictly increasing using dynamic…

困难
803

打砖块

Bricks Falling When Hit challenges your ability to simulate brick falls after sequential erasures using Union Find.

困难
804

唯一摩尔斯密码词

Determine how many unique Morse code transformations can be generated from a list of words using a hash table and array …

简单
805

数组的均值分割

Determine whether an integer array can be partitioned into two non-empty subarrays with the same average using dynamic p…

困难
806

写字符串需要的行数

Calculate how many lines are needed to write a string given individual letter widths, constrained to 100 pixels per line…

简单
807

保持城市天际线

Maximize building heights in a city grid without changing the skyline, using greedy selection constrained by row and col…

中等
809

情感丰富的文字

Expressive Words challenges you to determine if a word can be transformed into a given string by extending groups of rep…

中等
810

黑板异或游戏

The Chalkboard XOR Game is a game theory problem involving array manipulation and bitwise XOR, where players alternate e…

困难
811

子域名访问计数

The Subdomain Visit Count problem requires counting the visits to all subdomains of a given domain from a list of count-…

中等
812

最大三角形面积

Find the area of the largest triangle formed by three distinct points on a 2D plane.

简单
813

最大平均值和的分组

Maximize the sum of averages by partitioning an integer array into at most k contiguous subarrays using dynamic programm…

中等
815

公交路线

Bus Routes is solved by BFS over buses and stops, using stop-to-route hashing to avoid expensive repeated route scans.

困难
817

链表组件

Count the number of connected components in a linked list subset using array scanning and hash table lookups efficiently…

中等
819

最常见的单词

Find the most frequent non-banned word in a paragraph, excluding punctuation, using an efficient array scan and hash tab…

简单
820

单词的压缩编码

Find the minimum length of a reference string encoding an array of words using array scanning and hash lookup efficientl…

中等
821

字符的最短距离

Compute the minimum distance from each character in a string to a target character using efficient scanning techniques.

简单
822

翻转卡片游戏

The Card Flipping Game problem asks for the smallest integer that can be facing down but not up after flipping cards.

中等
823

带因子的二叉树

Given an array of integers, find how many binary trees can be formed such that non-leaf nodes' values are the product of…

中等
825

适龄的朋友

The Friends Of Appropriate Ages problem involves counting valid friend requests between people based on their ages with …

中等
826

安排工作以达到最大收益

Assign workers to jobs maximizing total profit using difficulty, profit, and worker arrays efficiently with binary searc…

中等
827

最大人工岛

Calculate the largest island size by converting at most one zero in a binary grid using array and DFS techniques efficie…

困难
832

翻转图像

Flip each row of a binary matrix horizontally and invert its values efficiently using a two-pointer scanning approach.

简单
833

字符串中的查找与替换

This problem challenges you to perform multiple string replacements at specific indices using a pattern involving array …

中等
835

图像重叠

Image Overlap requires calculating the overlap between two binary matrices by translating one image over the other.

中等
839

相似字符串组

Determine the number of connected groups of similar strings by swapping at most two letters using array scanning and has…

困难
840

矩阵中的幻方

Scan every 3x3 window, reject invalid digits fast, then verify row, column, and diagonal sums for Magic Squares In Grid.

中等
843

猜猜这个单词

Master the Guess the Word problem by applying array manipulation, match-counting math, and strategic interactive guessin…

困难
845

数组中的最长山脉

Find the length of the longest subarray forming a mountain pattern using state transitions and two-pointer logic efficie…

中等
846

一手顺子

Check if a hand of cards can be rearranged into groups of consecutive values.

中等
848

字母移位

Given a string and a shift array, shift the first i+1 letters of the string as specified in the array.

中等
849

到最近的人的最大距离

Determine the seat placement that maximizes distance to the nearest person using a linear array scan strategy efficientl…

中等
850

矩形面积 II

The problem involves calculating the total area covered by multiple rectangles, ensuring overlap is counted only once.

困难
851

喧闹和富有

Determine the quietest person richer than each individual using graph indegree analysis and topological ordering techniq…

中等
852

山脉数组的峰顶索引

Find the peak index in a mountain array using binary search for efficient O(log n) time complexity.

中等
853

车队

The Car Fleet problem asks how many car fleets will reach a target given their starting positions and speeds, considerin…

中等
857

雇佣 K 名工人的最低成本

Find the minimum cost to hire exactly k workers based on quality and wage expectations in this challenging greedy proble…

困难
860

柠檬水找零

Determine if you can provide exact change to every customer at a lemonade stand using greedy bill management techniques.

简单
861

翻转矩阵后的得分

Maximize the score of a binary matrix by flipping rows and columns using a greedy approach and validation of invariants.

中等
862

和至少为 K 的最短子数组

Find the shortest subarray with a sum of at least k using binary search and sliding window techniques.

困难
864

获取所有钥匙的最短路径

Find the minimum steps to collect all keys in a grid using BFS and bitmasking, handling locks efficiently.

困难
867

转置矩阵

Transpose Matrix problem requires flipping a matrix's rows and columns to return the transposed version.

简单
870

优势洗牌

Maximize the advantage of nums1 over nums2 using a two-pointer greedy strategy, carefully tracking which elements beat o…

中等
871

最低加油次数

Determine the minimum number of refueling stops needed to reach a target using dynamic programming and greedy strategies…

困难
873

最长的斐波那契子序列的长度

Find the length of the longest Fibonacci-like subsequence from a strictly increasing array of integers.

中等
874

模拟行走机器人

The Walking Robot Simulation problem involves moving a robot in an infinite grid and calculating its furthest distance f…

中等
875

爱吃香蕉的珂珂

Koko Eating Bananas challenges you to find the minimum eating speed to finish piles of bananas in a given time using bin…

中等
877

石子游戏

Stone Game is a dynamic programming problem where players alternate taking stones from piles to maximize their score.

中等
879

盈利计划

Given a group of members and a list of crimes, count the profitable schemes that meet the profit and group constraints.

困难
881

救生艇

Find the minimum number of boats required to save all people, using a two-pointer approach for efficient pairing.

中等
883

三维形体投影面积

Calculate the projection area of a 3D shape defined by a grid of towers with varying heights.

简单
885

螺旋矩阵 III

Solve the Spiral Matrix III problem by simulating the movement across a matrix with specific constraints on direction an…

中等
888

公平的糖果交换

Determine which single candy box Alice and Bob should swap to equalize their total candies using array scanning and hash…

简单
889

根据前序和后序遍历构造二叉树

Reconstruct a binary tree from preorder and postorder traversals using array scanning and hash lookup.

中等
890

查找和替换模式

Identify all words matching a given pattern by checking consistent letter mappings using hash tables and array scanning …

中等
891

子序列宽度之和

Calculate the sum of widths for all subsequences in an integer array using sorting and combinatorial math efficiently.

困难
892

三维形体的表面积

Solve the Surface Area of 3D Shapes problem using array manipulation and mathematical formulas to calculate surface area…

简单
893

特殊等价字符串组

Determine the number of special-equivalent string groups using character swaps at even or odd indices efficiently.

中等
896

单调数列

Determine if an integer array is entirely monotone increasing or decreasing using a clear array-driven approach.

简单
898

子数组按位或操作

Compute the number of unique bitwise OR values from all non-empty subarrays using dynamic state transitions efficiently.

中等
900

RLE 迭代器

Design an efficient iterator for a run-length encoded array, handling large counts and sequential access correctly every…

中等
902

最大为 N 的数字组合

The 'Numbers At Most N Given Digit Set' problem requires calculating how many numbers can be formed using a given digit …

困难
904

水果成篮

The Fruit Into Baskets problem requires finding the maximum number of fruits you can pick from a row of trees under spec…

中等
905

按奇偶排序数组

Reorder an integer array so all even numbers come before odd numbers using a precise two-pointer scanning method.

简单
907

子数组的最小值之和

Calculate the sum of minimum values across all subarrays of a given array modulo 10^9 + 7.

中等
908

最小差值 I

Find the smallest score of an array after applying an operation to each element within a given range.

简单
909

蛇梯棋

Solve the Snakes and Ladders problem using a BFS strategy to efficiently navigate the board and reach the final square.

中等
910

最小差值 II

Determine the minimum possible difference between the largest and smallest numbers after adjusting each by plus or minus…

中等
911

在线选举

Solve the Online Election problem by implementing a class that tracks votes and queries the leading candidate at any giv…

中等
912

排序数组

Sort an array using an optimal algorithm, focusing on time and space complexity considerations.

中等
914

卡牌分组

Solve the problem of determining if a deck can be partitioned into groups with equal occurrences of card values.

简单
915

分割数组

Partition the array into two subarrays such that the left contains the smallest possible elements and the right contains…

中等
916

单词子集

Word Subsets is solved by merging words2 into one max-frequency requirement, then scanning words1 against that fixed let…

中等
918

环形子数组的最大和

Find the maximum sum of a circular subarray using state transition dynamic programming, optimizing for wraparound cases …

中等
922

按奇偶排序数组 II

Sort an array where even numbers appear at even indices and odd numbers appear at odd indices using two-pointer scanning…

简单
923

三数之和的多种可能

Count all unique triplets in an integer array whose sum equals the target, handling multiplicity efficiently using hashi…

中等
924

尽量减少恶意软件的传播

Identify which single infected node to remove to minimize total malware spread in a connected network graph efficiently.

困难
927

三等分

Divide a binary array into three contiguous parts such that each part represents the same integer value in binary, using…

困难
928

尽量减少恶意软件的传播 II

Minimize Malware Spread II asks to minimize the spread of malware in a network of nodes by removing one infected node.

困难
929

独特的电子邮件地址

Identify the count of unique email addresses by normalizing local names and using hash-based lookups efficiently.

简单
930

和相同的二元子数组

Count all contiguous subarrays in a binary array whose elements sum exactly to a given goal using prefix sums efficientl…

中等
931

下降路径最小和

Minimum Falling Path Sum is a matrix dynamic programming problem where each cell depends on three reachable cells above …

中等
932

漂亮数组

Beautiful Array builds a valid permutation by recursively separating odd and even positions so no middle-average triple …

中等
934

最短的桥

Find the minimum flips to connect two separate islands in a binary matrix using Array and DFS techniques efficiently.

中等
937

重新排列日志文件

Reorder Data in Log Files requires sorting letter-logs lexicographically while keeping digit-logs in original order for …

中等
939

最小面积矩形

Find the minimum area of a rectangle formed by given points on a 2D plane with sides parallel to axes.

中等
941

有效的山脉数组

The 'Valid Mountain Array' problem requires determining if an array meets the conditions of a valid mountain array using…

简单
942

增减字符串匹配

Reconstruct a permutation from a DI string using two-pointer scanning, carefully tracking the increasing and decreasing …

简单
943

最短超级串

This problem requires constructing the shortest string containing all input words using state transition dynamic program…

困难
944

删列造序

The 'Delete Columns to Make Sorted' problem asks to remove unsorted columns from a string array, ensuring all columns ar…

简单
945

使数组唯一的最小增量

This problem challenges you to find the minimum moves to make all elements in an array unique by incrementing elements.

中等
946

验证栈序列

Determine if a sequence of push and pop operations can produce the given popped array using a stack-based state approach…

中等
948

令牌放置

Maximize your score in the Bag of Tokens problem by strategically playing tokens with two-pointer scanning and greedy te…

中等
949

给定数字能组成的最大时间

Given four digits, determine the latest valid 24-hour time possible using each digit exactly once with backtracking.

中等
950

按递增顺序显示卡牌

Determine the initial deck order to reveal cards in strictly increasing order using queue-driven simulation logic.

中等
952

按公因数计算最大组件大小

Find the largest connected component in an array where edges exist between numbers sharing a common factor greater than …

困难
953

验证外星语词典

Verify if a sequence of words is sorted according to an alien language's custom alphabet order using array scanning and …

简单
954

二倍数对数组

Given an array of even length, check if it can be reordered to satisfy a specific doubling condition.

中等
955

删列造序 II

Solve the "Delete Columns to Make Sorted II" problem by applying greedy choices and invariant validation to string array…

中等
956

最高的广告牌

Solve the Tallest Billboard problem by using dynamic programming to find the maximum equal height for two disjoint rod s…

困难
957

N 天后的牢房

Determine the state of 8 prison cells after N days using array scanning and cycle detection for repeated patterns effici…

中等
959

由斜杠划分区域

Determine the number of regions in a grid divided by slashes using array scanning and union-find techniques efficiently.

中等
960

删列造序 III

The problem requires minimizing deletions to ensure all strings are lexicographically sorted. Use dynamic programming fo…

困难
961

在长度 2N 的数组中找出重复 N 次的元素

Find the element that is repeated exactly N times in a 2N-sized array using array scanning and hash lookups.

简单
962

最大宽度坡

Find the maximum width of a ramp where nums[i] <= nums[j] for i < j using a two-pointer approach.

中等
963

最小面积矩形 II

Find the minimum area rectangle from given points in the X-Y plane, with sides not necessarily parallel to the axes.

中等
966

元音拼写检查器

Implement a spellchecker that matches queries to a wordlist using exact, case-insensitive, and vowel-error rules efficie…

中等
969

煎饼排序

Sort an array using pancake flips, leveraging two-pointer scanning and invariant tracking to iteratively position the la…

中等
973

最接近原点的 K 个点

Find the k closest points to the origin in a 2D plane using array operations and Euclidean distance calculations efficie…

中等
974

和可被 K 整除的子数组

Count the number of subarrays whose sum is divisible by a given integer k using array scanning and hash lookup.

中等
975

奇偶跳

Determine the number of valid starting indices in an array where you can reach the end with alternating odd and even jum…

困难
976

三角形的最大周长

Given an integer array, find the largest perimeter of a triangle formed from three of these lengths.

简单
977

有序数组的平方

The problem involves squaring elements of a sorted array and returning the squares in non-decreasing order.

简单
978

最长湍流子数组

Find the length of the longest subarray where element comparisons alternate, using state transition dynamic programming …

中等
980

不同路径 III

Solve the Unique Paths III problem using backtracking search with pruning to count 4-directional paths covering all empt…

困难
982

按位与为零的三元组

Count all index triples in an array where the bitwise AND of their elements equals zero using efficient bit manipulation…

困难
983

最低票价

Solve the Minimum Cost For Tickets problem using state transition dynamic programming for optimal travel ticket purchase…

中等
985

查询后的偶数和

Efficiently update an integer array based on queries and compute the sum of even numbers after each modification using s…

中等
986

区间列表的交集

This problem requires finding the intersection of two lists of intervals using a two-pointer technique with invariant tr…

中等
989

数组形式的整数加法

Compute the sum of an integer and a number represented as an array, efficiently handling digit carries and array travers…

简单
990

等式方程的可满足性

Determine if it's possible to assign values to variables such that all equations are satisfied based on equality and ine…

中等
992

K 个不同整数的子数组

Find subarrays with exactly k distinct integers in an integer array using sliding window and hash lookup techniques.

困难
994

腐烂的橘子

Given a grid with fresh and rotten oranges, return the minimum time for all oranges to rot or -1 if impossible.

中等
995

K 连续位的最小翻转次数

Determine the minimum number of k-length consecutive bit flips needed to convert all zeros to ones in a binary array eff…

困难
996

平方数组的数目

Count the number of squareful arrays from the given list of integers by checking adjacent pairs' sums for perfect square…

困难
997

找到小镇的法官

Find the Town Judge is an easy LeetCode problem that challenges you to identify a town judge from trust relationships us…

简单
999

可以被一步捕获的棋子数

This problem involves finding the number of pawns a rook can capture on a chessboard, considering obstacles like bishops…

简单
1000

合并石头的最低成本

Minimize the cost to merge stones with k consecutive piles using dynamic programming to achieve the optimal solution.

困难
1001

网格照明

Grid Illumination uses an array scanning approach with hash lookups to check illuminated cells in a large grid based on …

困难
1002

查找共用字符

Return an array of common characters from all strings in the given list of words, including duplicates.

简单
1004

最大连续1的个数 III

Find the longest consecutive ones in a binary array by optimally flipping at most k zeros using sliding window technique…

中等
1005

K 次取反后最大化的数组和

Maximize the sum of an integer array after exactly k negations using a greedy approach and invariant tracking for optima…

简单
1007

行相等的最少多米诺旋转

Minimize domino rotations to make either row identical in the problem of Minimum Domino Rotations For Equal Row.

中等
1008

前序遍历构造二叉搜索树

Construct a binary search tree directly from a preorder traversal array using stack-based state tracking efficiently.

中等
1010

总持续时间可被 60 整除的歌曲

Calculate the number of song pairs whose total durations sum to a multiple of 60 using array scanning and hash lookups.

中等
1011

在 D 天内送达包裹的能力

Find the minimum ship capacity needed to ship all packages within D days, ensuring the cargo is shipped in the given ord…

中等
1013

将数组分成和相等的三个部分

Determine if an array can be partitioned into three non-empty parts with equal sum using greedy choice and validation.

简单
1014

最佳观光组合

Compute the maximum sightseeing score efficiently using state transition dynamic programming and single-pass array itera…

中等
1018

可被 5 整除的二进制前缀

Determine which binary prefixes of a given array are divisible by 5 using bit manipulation for efficient checks.

简单
1019

链表中的下一个更大节点

Find the next greater value for each node in a linked list using monotonic stack techniques for efficient traversal.

中等
1020

飞地的数量

This problem involves finding the number of land cells that cannot reach the boundary in a grid using DFS and array mani…

中等
1023

驼峰式匹配

Camelcase Matching is a medium difficulty problem where you match queries to a given pattern by inserting lowercase lett…

中等
1024

视频拼接

Solve the "Video Stitching" problem using state transition dynamic programming to cover a sporting event with minimum cl…

中等
1027

最长等差数列

Find the length of the longest arithmetic subsequence in a given integer array using scanning and hash-based lookup.

中等
1029

两地调度

Two City Scheduling requires selecting optimal city assignments for 2n people to minimize total travel costs efficiently…

中等
1030

距离顺序排列矩阵单元格

Compute all matrix cell coordinates sorted by Manhattan distance from a given center using array and math techniques eff…

简单
1031

两个无重叠子数组的最大和

Find the maximum sum of two non-overlapping subarrays by efficiently using state transition dynamic programming.

中等
1032

字符流

Implement a StreamChecker that detects if any suffix of a character stream matches a given list of words using efficient…

困难
1034

边界着色

Given a grid and a starting cell, color all border cells of the connected component using DFS while preserving interior …

中等
1035

不相交的线

The Uncrossed Lines problem involves finding the maximum number of non-intersecting lines that can be drawn between two …

中等
1036

逃离大迷宫

The 'Escape a Large Maze' problem involves navigating a massive grid with blocked squares and finding if a target can be…

困难
1037

有效的回旋镖

Determine if three points on a 2D plane form a boomerang, based on distinctness and non-collinearity.

简单
1039

多边形三角剖分的最低得分

Compute the minimum total score to triangulate a convex polygon using state transition dynamic programming on vertex val…

中等
1040

移动石子直到连续 II

Determine the minimum and maximum moves to make stones consecutive using sliding window and endpoint adjustments efficie…

中等
1043

分隔数组以得到最大和

Partition an array into subarrays of length at most k, replacing each with its maximum to maximize total sum efficiently…

中等
1046

最后一块石头的重量

In the 'Last Stone Weight' problem, we smash the two heaviest stones until one remains, using heaps or sorting.

简单
1048

最长字符串链

Find the longest word chain by scanning arrays and using hash lookups to efficiently track predecessor-successor sequenc…

中等
1049

最后一块石头的重量 II

In the 'Last Stone Weight II' problem, you need to find the minimal possible stone weight after a series of smashes usin…

中等
1051

高度检查器

Determine how many students are out of place in a line by comparing their heights to the sorted expected order efficient…

简单
1052

爱生气的书店老板

Maximize satisfied customers in a bookstore by strategically suppressing the owner's grumpy minutes using a sliding wind…

中等
1053

交换一次的先前排列

Find the lexicographically largest permutation smaller than the given array using exactly one swap, leveraging a greedy …

中等
1054

距离相等的条形码

Rearrange barcodes in an array so that no two adjacent elements are equal, using a greedy approach and hash table for ef…

中等
1072

按列翻转得到最大值等行数

Maximize the number of equal rows in a binary matrix by flipping any number of columns.

中等
1073

负二进制数相加

Add two numbers represented in negabinary format and return the result in the same format.

中等
1074

元素和为目标值的子矩阵数量

Count all non-empty submatrices in a given matrix whose elements sum exactly to the target using efficient scanning tech…

困难
1089

复写零

Duplicate each zero in a fixed-length array in place, shifting elements right using a two-pointer scanning approach effi…

简单
1090

受标签影响的最大值

Maximize the sum of selected item values while respecting label use limits using array scanning and hash tracking.

中等
1091

二进制矩阵中的最短路径

Find the shortest clear path in a binary matrix using BFS, carefully handling obstacles and diagonal movements for effic…

中等
1093

大样本统计

Calculate minimum, maximum, mean, median, and mode from a large sample represented by an array of counts.

中等
1094

拼车

Determine if a car can handle multiple trips without exceeding its capacity using array sorting and event simulation tec…

中等
1095

山脉数组中查找目标值

Find in Mountain Array requires locating a target using binary search over a peak-structured array efficiently in intera…

困难
1105

填充书架

Determine the minimum total height of a bookcase by placing books in order using state transition dynamic programming.

中等
1109

航班预订统计

Solve Corporate Flight Bookings by marking range changes once, then building final seat totals with a single prefix sum …

中等
1110

删点成林

Delete nodes from a binary tree using array scanning and hash lookup to return the remaining forest efficiently.

中等
1122

数组的相对排序

Sort arr1 by the relative order of arr2, with remaining elements placed in ascending order.

简单
1124

表现良好的最长时间段

The Longest Well-Performing Interval problem challenges you to find the longest subarray where tiring days exceed non-ti…

中等
1125

最小的必要团队

Find the smallest subset of people covering all required skills using bitmask dynamic programming for efficient state tr…

困难
1128

等价多米诺骨牌对的数量

Count all pairs of dominoes that are equivalent by scanning the array and using a hash table for fast lookup.

简单
1130

叶值的最小代价生成树

Compute the minimum sum of non-leaf nodes in a binary tree formed from array leaves using dynamic programming efficientl…

中等
1131

绝对值表达式的最大值

Calculate the largest sum of absolute differences across two arrays and their indices using an efficient pattern-based a…

中等
1139

最大的以 1 为边界的正方形

Find the largest square of 1s with 1s on its borders in a binary grid using dynamic programming.

中等
1140

石子游戏 II

Stone Game II is a dynamic programming problem where Alice and Bob alternate taking stones from piles to maximize their …

中等
1144

递减元素使数组呈锯齿状

Transform any integer array into a zigzag pattern with minimal decrements using a targeted greedy approach and invariant…

中等
1146

快照数组

Implement a SnapshotArray that efficiently tracks element changes and retrieves past states using array scanning and has…

中等
1157

子数组中占绝大多数的元素

Efficiently find the majority element in any subarray using a data structure optimized for multiple range queries.

困难
1160

拼写单词

Compute the total length of words that can be fully constructed from given characters using array scanning and hash mapp…

简单
1162

地图分析

Find the farthest water cell from land in a grid and return the Manhattan distance using state transition dynamic progra…

中等
1169

查询无效交易

Detect invalid transactions by scanning arrays and cross-checking with hash tables for time, amount, and city conflicts …

中等
1170

比较字符串最小字母出现频次

Compare Strings by Frequency of the Smallest Character requires counting minimal character frequencies in words and quer…

中等
1177

构建回文串检测

Given a string and queries, determine if a substring can be rearranged and modified to form a palindrome.

中等
1178

猜字谜

Solve the "Number of Valid Words for Each Puzzle" problem with array scanning and hash lookup to efficiently count valid…

困难
1184

公交站间的距离

Compute the minimal distance between two bus stops on a circular route using an array-driven solution approach.

简单
1186

删除一次得到子数组最大和

Find the maximum sum of a subarray with at most one deletion in this dynamic programming problem.

中等
1187

使数组严格递增

Determine the minimum operations to transform arr1 into a strictly increasing sequence using values from arr2 efficientl…

困难
1191

K 次串联后最大子数组之和

Solve the K-Concatenation Maximum Sum problem using dynamic programming and optimal sub-array sum calculation.

中等
1200

最小绝对差

Find all pairs with the minimum absolute difference between two elements in an array, and return them in ascending order…

简单
1202

交换字符串中的元素

Find the lexicographically smallest string by swapping characters in given pairs of indices.

中等
1207

独一无二的出现次数

Determine if each integer in an array occurs a unique number of times using efficient hash-based counting and verificati…

简单
1210

穿过迷宫的最少移动次数

Find the minimum moves for a 2-cell snake to reach the bottom-right corner using rotations and BFS traversal in a grid.

困难
1217

玩筹码

Compute the minimum cost to move all chips to one position using parity-based greedy moves efficiently.

简单
1218

最长定差子序列

Find the longest arithmetic subsequence with a given difference using dynamic programming and hash tables.

中等
1219

黄金矿工

Find the path with the maximum gold in a grid with backtracking and pruning techniques to maximize the gold collected.

中等
1222

可以攻击国王的皇后

Identify all black queens on an 8x8 chessboard that can attack the white king using array and matrix simulation techniqu…

中等
1223

掷骰子模拟

Calculate all valid sequences of n dice rolls with consecutive roll constraints using state transition dynamic programmi…

困难
1224

最大相等频率

Find the longest prefix of an array where removing one element makes all numbers appear equally, using efficient hash tr…

困难
1232

缀点成线

Determine if a series of coordinates form a straight line on a 2D plane using geometry and mathematical principles.

简单
1233

删除子文件夹

Remove sub-folders in a filesystem by filtering out folders nested inside other folders.

中等
1235

规划兼职工作

Compute the maximum profit from non-overlapping jobs using state transition dynamic programming with sorted arrays and b…

困难
1239

串联字符串的最大长度

Find the maximum length of a concatenated string from an array with all unique characters using backtracking search with…

中等
1248

统计「优美子数组」

The problem requires counting subarrays with exactly k odd numbers using an efficient array scanning approach.

中等
1250

检查「好数组」

Determine if a given array of positive integers can generate 1 using integer multiples of any subset, leveraging number …

困难
1252

奇数值单元格的数目

This problem involves updating a matrix based on given indices and counting cells with odd values afterward.

简单
1253

重构 2 行二进制矩阵

Reconstruct a 2-row binary matrix by distributing column sums while respecting upper and lower row limits using greedy p…

中等
1254

统计封闭岛屿的数目

Count the number of closed islands in a 2D grid using array traversal and depth-first search efficiently.

中等
1255

得分最高的单词集合

Calculate the highest total score by selecting words from a list using available letters, respecting individual letter s…

困难
1260

二维网格迁移

Shift 2D Grid requires shifting elements of a matrix by a given number of times, simulating step-by-step movement.

简单
1262

可被三整除的最大和

Find the maximum sum divisible by three from a given array using dynamic programming and state transition.

中等
1263

推箱子

Solve the minimum moves to push a box to its target using BFS and priority handling in a grid-based warehouse layout eff…

困难
1266

访问所有点的最小时间

Calculate the minimum seconds required to visit all given 2D points in order using optimal diagonal or straight moves.

简单
1267

统计参与通信的服务器

Count Servers that Communicate involves identifying servers in a grid that can communicate based on row or column connec…

中等
1268

搜索推荐系统

Design a search suggestion system that provides the top three lexicographically smallest products matching a search word…

中等
1275

找出井字棋的获胜者

Determine the winner of a Tic Tac Toe game by scanning moves and using hash lookups for rows, columns, and diagonals eff…

简单
1277

统计全为 1 的正方形子矩阵

Count the number of square submatrices with all ones in a given binary matrix using dynamic programming.

中等
1282

用户分组

Organize people into groups based on their specified group sizes using array scanning and hash table bucketing efficient…

中等
1283

使结果不超过阈值的最小除数

Find the smallest divisor such that the sum of all divided array elements is less than or equal to the threshold.

中等
1284

转化为全零矩阵的最少反转次数

Compute the minimum flips to convert a binary matrix to zero by toggling cells and neighbors using array scanning plus h…

困难
1287

有序数组中出现次数超过25%的元素

Identify the integer occurring more than 25% in a sorted array using a precise array-driven search strategy for efficien…

简单
1288

删除被覆盖区间

Remove all intervals fully covered by another using sorting and linear traversal, counting only distinct remaining inter…

中等
1289

下降路径最小和 II

Find the minimum sum of a falling path in a square matrix using dynamic programming while avoiding same-column selection…

困难
1292

元素和小于等于阈值的正方形的最大边长

This problem challenges you to find the largest square in a matrix with a sum below a given threshold using binary searc…

中等
1293

网格中的最短路径

Find the shortest path in a grid with obstacles, allowing the elimination of up to k obstacles using BFS.

困难
1295

统计位数为偶数的数字

Count the integers in an array that have an even number of digits using a direct array traversal with digit math.

简单
1296

划分数组为连续数字的集合

Determine if an integer array can be partitioned into sets of k consecutive numbers using array scanning and hash mappin…

中等
1298

你能从盒子里获得的最大糖果数

Collect maximum candies from boxes by exploring initially available boxes and using keys to unlock additional ones effic…

困难
1299

将每个元素替换为右侧最大元素

Replace every element in an array with the greatest element on its right side, and replace the last element with -1.

简单
1300

转变数组后最接近目标值的数组和

Find the integer that mutates all larger elements in an array to minimize the sum difference to a target efficiently.

中等
1301

最大得分的路径数目

Calculate the maximum score path and count all valid routes in a square board with obstacles using dynamic programming.

困难
1304

和为零的 N 个不同整数

Generate an array of n unique integers that sum to zero using a symmetric pairing strategy to ensure balance.

简单
1306

跳跃游戏 III

Jump Game III challenges you to determine if you can reach any zero in an array using jumps defined by array values, tes…

中等
1307

口算难题

Check if a verbal arithmetic equation can be solved using a valid digit-letter mapping.

困难
1310

子数组异或查询

Compute XOR results for multiple subarray queries using efficient prefix XOR to reduce repeated computation overhead in …

中等
1311

获取你好友已观看的视频

Find videos watched by friends up to a given level and return them sorted by frequency and alphabetically.

中等
1313

解压缩编码列表

Decompress a run-length encoded list by expanding each pair into repeated values based on frequency.

简单
1314

矩阵区域和

Compute a matrix where each cell contains the sum of all elements within k-distance blocks using prefix sums efficiently…

中等
1324

竖直打印单词

Transform a string into vertical columns by arranging each word character in array positions while trimming trailing spa…

中等
1326

灌溉花园的最少水龙头数目

Determine the minimum number of taps to water an entire garden using state transition dynamic programming and interval c…

困难
1329

将矩阵按对角线排序

Sort each diagonal of a matrix in ascending order, applying sorting and matrix traversal techniques.

中等
1330

翻转子数组得到最大的数组值

Maximize the value of an array by reversing a subarray, focusing on greedy choices and invariant validation.

困难
1331

数组序号转换

Transform the elements of an array into their ranks, where the rank represents the size order of the elements.

简单
1333

餐厅过滤器

Filter restaurants by vegan-friendly status, price, and distance, and sort them by rating and ID.

中等
1335

工作计划的最低难度

Schedule jobs into multiple days to minimize the difficulty of the schedule using dynamic programming and state transiti…

困难
1337

矩阵中战斗力最弱的 K 行

Find the k weakest rows in a binary matrix where rows contain soldiers and civilians, using sorting and binary search te…

简单
1338

数组大小减半

This problem asks to minimize the set of integers removed to reduce an array's size to at least half by removing occurre…

中等
1340

跳跃游戏 V

Jump Game V is a hard dynamic programming problem that focuses on maximizing jumps between indices in an array.

困难
1343

大小为 K 且平均值大于等于阈值的子数组数目

Given an array, find the number of sub-arrays of size k with an average greater than or equal to a given threshold.

中等
1345

跳跃游戏 IV

Jump Game IV requires minimizing steps to reach the last index using jumps across equal values and neighbors efficiently…

困难
1346

检查整数及其两倍数是否存在

Solve Check If N and Its Double Exist by scanning once and checking doubles or halves in a hash set.

简单
1349

参加考试的最大学生数

Calculate the maximum number of students who can take an exam without cheating using state transition dynamic programmin…

困难
1351

统计有序矩阵中的负数

Count Negative Numbers in a Sorted Matrix requires counting negative numbers in a matrix sorted in non-increasing order …

简单
1352

最后 K 个数的乘积

Design a data structure to efficiently return the product of the last k numbers in a dynamic integer stream using prefix…

中等
1353

最多可以参加的会议数目

Maximize the number of events you can attend given their start and end days using a greedy strategy.

中等
1354

多次求和构造目标数组

This problem requires constructing a target array from an array of ones, using multiple sum operations and a priority qu…

困难
1356

根据数字二进制下 1 的数目排序

Sort an array of integers by the number of 1's in their binary representation and then by their value in case of ties.

简单
1357

每隔 n 个顾客打折

Compute customer bills with periodic discounts efficiently using array scanning and hash mapping for fast product price …

中等
1363

形成三的最大倍数

Find the largest number divisible by three by selecting and ordering digits optimally using state transition dynamic pro…

困难
1365

有多少小于当前数字的数字

In this problem, you need to determine how many numbers are smaller than each element in an array, focusing on array sca…

简单
1366

通过投票对团队排名

Rank Teams by Votes requires counting position-based votes and resolving ties with array scanning and hash lookup techni…

中等
1368

使网格图至少有一条有效路径的最小代价

Determine the minimum cost to create at least one valid path from the top-left to bottom-right in a directional grid.

困难
1375

二进制字符串前缀一致的次数

Count how many times a 1-indexed binary string becomes prefix-aligned as bits are flipped sequentially using an array-dr…

中等
1380

矩阵中的幸运数

The Lucky Numbers in a Matrix problem involves finding elements that are the minimum in their row and maximum in their c…

简单
1381

设计一个支持增量操作的栈

Implement a stack that supports push, pop, and targeted increment operations efficiently using array-based state managem…

中等
1383

最大的团队表现值

Maximize the performance of a team by selecting up to k engineers with the highest performance based on speed and effici…

困难
1385

两个数组间的距离值

Calculate the distance value between two integer arrays by determining how many elements in arr1 don't have a close coun…

简单
1386

安排电影院座位

Determine the maximum number of four-person groups that can be seated in a cinema using array scanning and hash lookup e…

中等
1388

3n 块披萨

Maximize your pizza slice sum from a 3n-sized circular array using state transition dynamic programming efficiently.

困难
1389

按既定顺序创建目标数组

Learn how to efficiently create a target array by inserting elements at specified indices using array simulation techniq…

简单
1390

四因数

Compute the sum of all divisors for numbers in an array that have exactly four divisors using array and math techniques.

中等
1391

检查网格中是否存在有效路径

Check if there is a valid path from the upper-left to the bottom-right corner of a grid using depth-first search.

中等
1394

找出数组中的幸运数

Identify the largest lucky integer in an array by counting frequencies and comparing values with their occurrences effic…

简单
1395

统计作战单位数

Count the number of valid three-soldier teams using ratings with a state transition dynamic programming approach efficie…

中等
1402

做菜顺序

Maximize the sum of like-time coefficients by optimally choosing dishes to prepare in this dynamic programming problem.

困难
1403

非递增顺序的最小子序列

Find the minimum subsequence in non-increasing order such that its sum exceeds the sum of non-included elements.

简单
1406

石子游戏 III

Stone Game III is a challenging dynamic programming problem based on game theory and state transition logic.

困难
1408

数组中的字符串匹配

Identify all strings in an array that appear as substrings of other strings, focusing on array and string matching patte…

简单
1409

查询带键的排列

This problem involves processing queries on a permutation using an array and binary indexed tree for efficient results.

中等
1413

逐步求和得到正数的最小值

Find the minimum starting value to ensure the step-by-step sum of an array is always at least 1.

简单
1418

点菜展示表

Generate a restaurant display table from orders by counting each food item per table using array scanning and hash looku…

中等
1423

可获得的最大点数

Maximize your score by selecting k cards from the beginning or end of the array using a sliding window approach.

中等
1424

对角线遍历 II

Traverse a jagged 2D array diagonally by grouping elements with equal row and column sums efficiently using sorting and …

中等
1425

带限制的子序列和

Solve the Constrained Subsequence Sum problem using dynamic programming, sliding window, and priority queues to maximize…

困难
1431

拥有最多糖果的孩子

Determine which kids, after receiving extra candies, will have the greatest number of candies in a group.

简单
1434

每个人戴不同帽子的方案数

Calculate all unique assignments of hats to people using state transition dynamic programming with bitmasking for collis…

困难
1436

旅行终点站

Find the destination city from a list of paths where each path connects two cities. The city with no outgoing path is th…

简单
1437

是否所有 1 都至少相隔 k 个元素

Check if all 1's in a binary array are at least k places away from each other.

简单
1438

绝对差不超过限制的最长连续子数组

Find the longest subarray with elements whose absolute difference is within a specified limit using a sliding window app…

中等
1439

有序矩阵中的第 k 个最小数组和

Find the kth smallest sum in a matrix with sorted rows using binary search and a heap-based approach.

困难
1441

用栈操作构建数组

Simulate stack operations to match a target array while processing numbers from 1 to n.

中等
1442

形成两个异或相等数组的三元组数目

Efficiently count all triplets in an array where two subarrays formed by splitting have equal XOR using array scanning a…

中等
1444

切披萨的方案数

This problem challenges you to determine the number of valid ways to cut a pizza into pieces with apples using dynamic p…

困难
1449

数位成本和为目标值的最大数字

Maximize the integer you can paint with given digit costs under a target sum, using dynamic programming to optimize the …

困难
1450

在既定时间做作业的学生人数

Count the number of students doing homework at a given time using an array-driven solution approach.

简单
1452

收藏清单

Identify people whose favorite companies lists are unique and not subsets of any other person's list using efficient arr…

中等
1453

圆形靶内的最大飞镖数量

Maximize the number of darts on a circular dartboard given dart positions and radius.

困难
1458

两个子序列的最大点积

Solve Max Dot Product of Two Subsequences with state transition dynamic programming that enforces a non-empty pairing de…

困难
1460

通过翻转子数组使两个数组相等

Solve Make Two Arrays Equal by Reversing Subarrays by checking whether target and arr contain the same values with match…

简单
1463

摘樱桃 II

Maximize cherry collection in a grid using two robots with careful state transition dynamic programming to optimize path…

困难
1464

数组中两元素的最大乘积

Find the maximum product of two elements in an array by carefully selecting indices and leveraging sorting for efficienc…

简单
1465

切割后面积最大的蛋糕

Maximize the area of a piece of cake after specified horizontal and vertical cuts using greedy algorithms and sorting.

中等
1467

两个盒子中球的颜色数相同的概率

Compute the probability that two boxes contain the same number of distinct balls using careful combinatorial and DP meth…

困难
1470

重新排列数组

Shuffle the Array requires an efficient approach to rearrange elements using an array-driven solution strategy with two …

简单
1471

数组中的 k 个最强值

Identify the k strongest values in an array using two-pointer scanning and careful tracking of the array's centre value.

中等
1472

设计浏览器历史记录

Implement a browser history tracker with back, forward, and visit operations using linked-list pointer manipulation effi…

中等
1473

粉刷房子 III

Solve Paint House III using state transition dynamic programming to minimize painting costs while forming exact neighbor…

困难
1475

商品折扣后的最终价格

Calculate final prices with discounts applied in a shop using a stack-based state management approach to find the correc…

简单
1476

子矩形查询

Implement the SubrectangleQueries class to handle dynamic updates and value queries on a 2D rectangle.

中等
1477

找两个和为目标值且不重叠的子数组

Find two non-overlapping sub-arrays with a given target sum and return the minimal total length efficiently using array …

中等
1478

安排邮筒

Allocate k mailboxes to houses along a street minimizing total distance using dynamic programming with state transitions…

困难
1480

一维数组的动态和

Calculate the running sum of a given 1D array by updating each element to the sum of itself and all previous elements.

简单
1481

不同整数的最少数目

Find the least number of unique integers after removing exactly k elements from an array using efficient frequency count…

中等
1482

制作 m 束花所需的最少天数

Determine the minimum number of days required to make m bouquets using k adjacent flowers efficiently with binary search…

中等
1487

保证文件名唯一

This problem requires creating unique folder names by appending suffixes to duplicate names using an array scanning and …

中等
1488

避免洪水泛滥

This problem asks you to avoid flooding by deciding when to dry lakes between rain events.

中等
1491

去掉最低工资和最高工资后的工资平均值

Calculate the average salary of employees, excluding the highest and lowest salaries, from an array of unique salaries.

简单
1493

删掉一个元素以后全为 1 的最长子数组

Solve LeetCode 1493 by tracking runs of 1s around one deletion using a tight sliding window or state transition DP.

中等
1497

检查数组对是否可以被 k 整除

Check if array pairs are divisible by k by pairing elements whose sums are divisible by k using array scanning and hash …

中等
1498

满足条件的子序列数目

Count all non-empty subsequences in an integer array where the sum of the minimum and maximum elements is at most a targ…

中等
1499

满足不等式的最大值

Max Value of Equation asks to find the maximum value of a specific equation on a set of 2D points using sliding window t…

困难
1502

判断能否形成等差数列

Determine if a given array can be rearranged into a valid arithmetic progression using sorting and consecutive differenc…

简单
1503

所有蚂蚁掉下来前的最后一刻

This problem involves simulating ant movement on a plank to determine the last moment before all ants fall off.

中等
1504

统计全 1 子矩形

Count Submatrices With All Ones is a dynamic programming problem focusing on submatrix counting using an efficient row-b…

中等
1508

子数组和排序后的区间和

Compute the sum of sorted subarray sums efficiently using binary search over valid sum ranges and prefix sum accumulatio…

中等
1509

三次操作后最大值与最小值的最小差

Find the minimum difference between the largest and smallest values in an array after performing at most three moves.

中等
1512

好数对的数目

Count all index pairs in an array where elements match and the first index is smaller, using hash-based scanning efficie…

简单
1514

概率最大的路径

Find the path with the highest success probability in a graph from a start node to an end node, using edge probabilities…

中等
1515

服务中心的最佳位置

Find the optimal service center position in a city by minimizing the sum of Euclidean distances to all customers.

困难
1521

找到最接近目标值的函数值

In this problem, you'll use binary search to find the closest value of a mysterious function to a given target.

困难
1524

和为奇数的子数组数目

Count the number of subarrays with an odd sum using dynamic programming and prefix sum techniques.

中等
1526

形成目标数组的子数组最少增加次数

The problem asks for the minimum number of operations to transform an initial array of zeros into a target array using s…

困难
1528

重新排列字符串

Reorder characters in a string using a given indices array to reconstruct the intended output efficiently and correctly.

简单
1534

统计好三元组

Count Good Triplets requires identifying all triplets in an array that satisfy multiple absolute difference constraints …

简单
1535

找出数组游戏的赢家

Determine the integer that wins an array game by achieving k consecutive victories through simulated pairwise comparison…

中等
1536

排布二进制网格的最少交换次数

Compute the minimum number of adjacent row swaps to transform a binary grid so all upper-triangle cells are zero using a…

中等
1537

最大得分

Find the maximum possible score from two sorted arrays with a dynamic programming approach, leveraging partitioning and …

困难
1539

第 k 个缺失的正整数

Find the kth missing positive integer in a strictly increasing array using binary search over the answer space efficient…

简单
1546

和为目标值且不重叠的非空子数组的最大数目

Find the maximum number of non-overlapping subarrays that sum to a given target using efficient scanning and hash lookup…

中等
1547

切棍子的最小成本

Find the minimum cost to cut a stick into segments at specified positions using dynamic programming and sorting.

困难
1550

存在连续三个奇数的数组

Determine if an integer array contains three consecutive odd numbers using a direct array-driven solution strategy for f…

简单
1552

两球之间的磁力

Maximize the minimum magnetic force between balls by strategically placing them in baskets using binary search on positi…

中等
1558

得到目标数组的最少函数调用次数

Calculate the minimum number of modify calls needed to convert an all-zero array into a given target array using greedy …

中等
1559

二维网格图中探测环

Detect cycles in a 2D character grid using DFS while carefully tracking parent cells to avoid invalid revisits.

中等
1560

圆形赛道上经过次数最多的扇区

Determine which sectors on a circular track are visited most frequently using array and simulation techniques efficientl…

简单
1561

你可以获得的最大硬币数目

Solve the Maximum Number of Coins You Can Get using greedy pile selection and invariant validation to maximize your coin…

中等
1562

查找大小为 M 的最新分组

Determine the latest step where a contiguous group of ones of exact length m exists using array scanning and hash tracki…

中等
1563

石子游戏 V

In Stone Game V, Alice divides stones into rows to maximize her score, using a dynamic programming approach to try all d…

困难
1566

重复至少 K 次且长度为 M 的模式

Determine if a subarray of length m repeats k or more consecutive times in a given integer array efficiently.

简单
1567

乘积为正数的最长子数组长度

Given an array, find the maximum length of a subarray with a positive product using dynamic programming.

中等
1568

使陆地分离的最少天数

Find the minimum number of days to disconnect an island in a grid using depth-first search.

困难
1569

将子数组重新排序得到同一个二叉搜索树的方案数

Determine the number of ways to reorder an array to get the same binary search tree (BST) from its insertion order.

困难
1572

矩阵对角线元素的和

Calculate the sum of both primary and secondary diagonals in a square matrix while avoiding double-counting overlaps.

简单
1574

删除最短的子数组使剩余数组有序

Find the shortest subarray to remove in order to make an array non-decreasing using binary search and two-pointer techni…

中等
1575

统计所有可行路径

This problem requires counting all possible routes between cities using fuel efficiently with state transition dynamic p…

困难
1577

数的平方等于两数乘积的方法数

Find the number of triplets where the square of a number equals the product of two others, utilizing array scanning and …

中等
1578

使绳子变成彩色的最短时间

Minimize the time Bob needs to remove balloons to make a rope colorful using dynamic programming with state transitions.

中等
1582

二进制矩阵中的特殊位置

Identify all special positions in a binary matrix where a 1 has no other 1s in its row or column, ensuring optimal array…

简单
1583

统计不开心的朋友

Determine the number of unhappy friends in paired arrangements using array-based simulation for preference violations.

中等
1584

连接所有点的最小费用

Min Cost to Connect All Points asks for the minimum cost to connect all points on a 2D plane, using manhattan distances …

中等
1588

所有奇数长度子数组的和

Calculate the sum of all odd-length subarrays in a given integer array using efficient array and math strategies.

简单
1589

所有排列中的最大和

Maximize the total sum of requests on nums by greedily assigning larger numbers to most frequently requested indices.

中等
1590

使数组和能被 P 整除

Determine the minimum-length subarray to remove so the remaining array sum is divisible by a given integer p efficiently…

中等
1591

奇怪的打印机 II

Solve Strange Printer II by building color dependencies from bounding rectangles and checking whether a topological orde…

困难
1594

矩阵的最大非负积

Find the maximum non-negative product path in a matrix using dynamic programming and state transition.

中等
1595

连通两组点的最小成本

Compute the minimum cost to fully connect two groups of points using dynamic programming and bitmasking efficiently.

困难
1598

文件夹操作日志搜集器

Simulate folder navigation based on a list of operations to determine the current folder depth.

简单
1599

经营摩天轮的最大利润

Maximize the profit from operating a Centennial Wheel by determining the optimal number of rotations based on customer a…

中等
1601

最多可达成的换楼请求数目

Find the maximum number of achievable transfer requests between buildings with constraints on net employee transfers.

困难
1604

警告一小时内使用相同员工卡大于等于三次的人

Solve LeetCode 1604 by grouping swipe times per employee, sorting each list, and scanning for any three within 60 minute…

中等
1605

给定行和列的和求可行矩阵

Given row and column sums, find any valid matrix of non-negative integers that satisfies them.

中等
1606

找到处理最多请求的服务器

Given k servers and a series of requests, find the busiest server(s) using greedy strategies and efficient server tracki…

困难
1608

特殊数组的特征值

Determine if an array has exactly x elements greater than or equal to x using binary search over the answer space.

简单
1610

可见点的最大数目

Determine the maximum number of points visible from a fixed location within a given angle using a sliding window approac…

困难
1619

删除某些元素后的数组均值

Calculate the trimmed mean by removing the lowest and highest 5% of elements in an array using sorting for accuracy and …

简单
1620

网络信号最好的坐标

Determine the coordinate with the maximum network quality by summing signal strengths from all reachable towers efficien…

中等
1626

无矛盾的最佳球队

Find the highest score basketball team by choosing players without conflicts in age and score using dynamic programming.

中等
1627

带阈值的图连通性

In 'Graph Connectivity With Threshold,' determine if cities are connected based on common divisors exceeding a threshold…

困难
1629

按键持续时间最长的键

Determine which key had the longest press duration in a sequence using array indices and string mapping, resolving ties …

简单
1630

等差子数组

Determine whether subarrays of a given array can be rearranged to form arithmetic sequences using array scanning and has…

中等
1631

最小体力消耗路径

Find the minimum effort required to travel from the top-left to the bottom-right of a grid, considering height differenc…

中等
1632

矩阵转换后的排名

Compute a unique rank matrix using graph indegree with topological ordering, ensuring each element reflects its relative…

困难
1636

按照频率将数组升序排序

Sort Array by Increasing Frequency requires counting each element and ordering them by frequency, breaking ties with des…

简单
1637

两点之间不包含任何点的最宽垂直区域

Find the maximum width of a vertical area between points with no points inside using array sorting efficiently.

简单
1639

通过给定词典构造目标字符串的方案数

Calculate the number of ways to form a target string using words of equal length via state transition dynamic programmin…

困难
1640

能否连接形成数组

Determine if an array can be formed by concatenating subarrays without reordering individual elements, using hash lookup…

简单
1642

可以到达的最远建筑

Furthest Building You Can Reach explores a greedy approach with heap-based optimization to find the maximum reachable bu…

中等
1643

第 K 条最小指令

Find the kth smallest lexicographic instruction sequence for reaching a destination in a grid using state transition dyn…

困难
1646

获取生成数组中的最大值

Compute the maximum value in a generated array using defined recurrence rules, leveraging array simulation techniques ef…

简单
1648

销售价值减少的颜色球

Maximize total value by greedily selling diminishing-valued colored balls based on inventory and customer orders.

中等
1649

通过指令创建有序数组

The problem asks to compute the cost of inserting elements into a sorted array using a series of instructions.

困难
1652

拆炸弹

Defuse the Bomb uses a sliding window to update a circular array based on a key, with efficient state updates.

简单
1654

到家的最少跳跃次数

Find the minimum number of jumps needed to reach a target position while avoiding forbidden positions.

中等
1655

分配重复整数

Determine if you can allocate integers to satisfy customer quantities using state transition dynamic programming techniq…

困难
1656

设计有序流

Design an Ordered Stream that returns values in increasing order based on unique integer IDs with efficient insertion an…

简单
1658

将 x 减到 0 的最小操作数

Find the minimum number of operations to reduce a value x to zero by removing elements from an array.

中等
1662

检查两个字符串数组是否相等

Determine if two string arrays form identical strings by concatenating elements in order, handling subtle array-length m…

简单
1664

生成平衡数组的方案数

Solve Ways to Make a Fair Array by tracking parity sums before and after each removal with prefix-sum style accounting.

中等
1665

完成所有任务的最少初始能量

Determine the minimum initial energy needed to finish all tasks using a greedy ordering based on required versus actual …

困难
1670

设计前中后队列

Implement a queue that efficiently handles push and pop operations at the front, middle, and back using pointer manipula…

中等
1671

得到山形数组的最少删除次数

Solve the problem of finding the minimum number of removals to make a given array a mountain array using dynamic program…

困难
1672

最富有客户的资产总量

Calculate the richest customer's wealth by summing the amounts in each customer's bank accounts in a matrix.

简单
1673

找出最具竞争力的子序列

Identify the lexicographically smallest subsequence of size k using stack-based greedy selection in array traversal.

中等
1674

使数组互补的最少操作次数

Find the minimum moves to make an array complementary by analyzing paired sums and using hash lookups for efficiency.

中等
1675

数组的最小偏移量

Given a positive integer array, repeatedly double or halve elements to minimize the difference between its largest and s…

困难
1679

K 和数对的最大数目

Max Number of K-Sum Pairs is a problem involving counting disjoint pairs with a given sum k in an array.

中等
1681

最小不兼容性

Optimize the sum of incompatibilities when distributing an array into subsets with unique elements.

困难
1684

统计一致字符串的数目

Count the number of strings fully composed of allowed characters using array scanning and hash lookup for efficiency.

简单
1685

有序数组中差绝对值之和

Calculate the sum of absolute differences between each element and others in a sorted array efficiently.

中等
1686

石子游戏 VI

Determine the winner in Stone Game VI using a greedy strategy that accounts for each stone's dual value impact on Alice …

中等
1687

从仓库到码头运输箱子

Optimize the minimum number of trips to deliver boxes to ports under strict ship constraints using dynamic programming t…

困难
1690

石子游戏 VII

Maximize score difference in a two-player turn-based stone removal game using state transition dynamic programming.

中等
1691

堆叠长方体的最大高度

Maximize the height of stacked cuboids by strategically rotating and stacking them using dynamic programming.

困难
1695

删除子数组的最大得分

Maximize the score by erasing a subarray with unique elements in an array of integers.

中等
1696

跳跃游戏 VI

Jump Game VI challenges you to maximize your score while jumping through an array using state transition dynamic program…

中等
1697

检查边长度限制的路径是否存在

Solve the problem of checking if there exists a path between two nodes under edge length constraints using efficient tec…

困难
1700

无法吃午餐的学生数量

Simulate a queue of students with sandwich preferences and determine how many can't eat based on available sandwiches.

简单
1701

平均等待时间

Compute the average waiting time for customers using array traversal and simulation of a single chef processing orders s…

中等
1703

得到连续 K 个 1 的最少相邻交换次数

Find the minimum number of adjacent swaps to gather k consecutive ones in a binary array using sliding window logic.

困难
1705

吃苹果的最大数目

Maximize apples eaten by choosing the best apples first, considering their rot days and available days to eat them.

中等
1706

球会落何处

Determine where each ball exits a diagonal board grid or if it gets stuck, using matrix simulation with careful traversa…

中等
1707

与数组中元素的最大异或值

Solve the Maximum XOR With an Element From Array problem by efficiently finding the maximum XOR for each query using bit…

困难
1710

卡车上的最大单元数

Maximize total units loaded on a truck by choosing boxes greedily based on highest units per box within truck capacity l…

简单
1711

大餐计数

Count Good Meals asks you to find pairs of food items with a sum of deliciousness equal to a power of two.

中等
1712

将数组分成三个子数组的方案数

The problem requires finding the number of ways to split an array into three subarrays where each split meets a certain …

中等
1713

得到子序列的最少操作次数

Compute the minimum insertions required to transform arr so that target becomes its subsequence using array scanning and…

困难
1718

构建字典序最大的可行序列

Construct the Lexicographically Largest Valid Sequence problem involves finding the largest sequence with backtracking a…

中等
1720

解码异或后的数组

Recover the original integer array from its XOR-encoded version using direct bitwise manipulation and sequential reconst…

简单
1722

执行交换操作后的最小汉明距离

Solve Minimize Hamming Distance After Swap Operations by grouping swappable indices and matching value counts inside eac…

中等
1723

完成所有工作的最短时间

Minimize the maximum working time of k workers by optimally assigning jobs, leveraging dynamic programming and bit manip…

困难
1725

可以形成最大正方形的矩形数目

Determine how many rectangles can be trimmed to form the largest possible square using an array-driven solution strategy…

简单
1726

同积元组

Given an array of distinct integers, return the number of tuples where the product of two pairs is the same.

中等
1727

重新排列后的最大子矩阵

Rearrange columns of a binary matrix to find the largest submatrix of 1s.

中等
1728

猫和老鼠 II

Cat and Mouse II requires determining if the mouse can reach food before being caught using graph and topological orderi…

困难
1732

找到最高海拔

Find the highest altitude after a series of altitude changes during a road trip using prefix sum technique.

简单
1733

需要教语言的最少人数

Minimize the number of users to teach a language that ensures all friends can communicate in a social network.

中等
1734

解码异或后的排列

Decode XORed Permutation uses prefix reconstruction with global XOR to recover the hidden odd-length permutation in line…

中等
1735

生成乘积数组的方案数

Determine the number of arrays of size n where the product equals k using prime factorization and combinatorial DP techn…

困难
1738

找出第 K 大的异或坐标值

Compute the kth largest XOR coordinate in a 2D matrix using prefix sums, bit manipulation, and optimized selection techn…

中等
1743

从相邻元素对还原数组

Restore the Array From Adjacent Pairs reconstructs a sequence using adjacent element pairs. Efficient hash lookups and a…

中等
1744

你能在你最喜欢的那天吃到你最喜欢的糖果吗?

Determine if you can eat a candy of your favorite type on a specific day, given daily limits and candy availability.

中等
1748

唯一元素的和

Given an array, find the sum of all its unique elements by identifying those that appear only once.

简单
1749

任意子数组和的绝对值的最大值

Solve for the maximum absolute sum of any subarray using dynamic programming and understanding state transitions.

中等
1751

最多可以参加的会议数目 II

Determine the maximum sum of event values you can collect by attending at most k non-overlapping events using DP.

困难
1752

检查数组是否经排序和轮转得到

Determine if a given integer array is sorted in non-decreasing order and then rotated, handling duplicates correctly.

简单
1755

最接近目标值的子序列和

Find the minimum absolute difference between a target goal and any subsequence sum using optimized dynamic programming a…

困难
1760

袋子里最少数目的球

Find the minimum penalty (maximum balls in a bag) after performing up to maxOperations to split bags of balls.

中等
1764

通过连接另一个数组的子数组得到一个数组

Determine if you can sequentially select disjoint subarrays from nums matching each group in order using two-pointer sca…

中等
1765

地图中的最高点

Solve the Map of Highest Peak problem using breadth-first search to assign heights based on proximity to water cells.

中等
1766

互质树

Determine the closest coprime ancestor for each node in a tree using efficient traversal and state tracking of node valu…

困难
1769

移动所有球到每个盒子所需的最小操作数

Solve the problem of finding the minimum operations to move balls to each box using an efficient approach with arrays an…

中等
1770

执行乘法运算的最大分数

Solve the Maximum Score from Performing Multiplication Operations problem using dynamic programming and state transition…

困难
1773

统计匹配检索规则的物品数量

Count Items Matching a Rule is an easy problem that tests array and string manipulation with conditions based on specifi…

简单
1774

最接近目标价格的甜点成本

Find the closest dessert cost to a target by selecting from a list of base flavors and topping combinations using dynami…

中等
1775

通过最少操作次数使数组的和相等

Solve the problem of balancing the sums of two integer arrays with minimal operations, using array scanning and hash loo…

中等
1776

车队 II

Car Fleet II involves calculating collision times between cars traveling at different speeds along a one-lane road using…

困难
1779

找到最近的有相同 X 或 Y 坐标的点

Find the nearest point with the same x or y coordinate using Manhattan distance. Return its index or -1 if none exists.

简单
1782

统计点对的数目

Given a graph with nodes and edges, count pairs of nodes where the degree sum exceeds a given threshold for each query.

困难
1785

构成特定和需要添加的最少元素

Compute the gap between current sum and goal, then greedily cover it with limit-sized additions to get the minimum count…

中等
1787

使所有区间的异或结果为零

Determine the minimum changes needed in an array so all size-k segments XOR to zero using DP and bit manipulation.

困难
1792

最大平均通过率

Maximize the average pass ratio by assigning extra guaranteed-passing students using a greedy heap strategy for optimal …

中等
1793

好子数组的最大分数

Maximize the score of a good subarray using binary search to explore the valid answer space with a focus on two-pointer …

困难
1798

你能构造出连续值的最大数目

Find the maximum number of consecutive integer values starting from zero that can be formed using your coins array.

中等
1799

N 次操作后的最大分数和

Maximize the score after n operations by selecting pairs from the array and using their GCD with dynamic programming or …

困难
1800

最大升序子数组和

Solve Maximum Ascending Subarray Sum by scanning once, extending rising runs, and resetting the running sum at each drop…

简单
1801

积压订单中的订单总数

Determine the total number of unfulfilled buy and sell orders using heaps to simulate backlog processing efficiently in …

中等
1803

统计异或值在范围内的数对有多少

Count all pairs in an array whose XOR falls within a given range using efficient bit manipulation techniques and a trie …

困难
1806

还原排列的最少操作步数

Find the minimum number of operations to reinitialize a permutation of size n using specific operations.

中等
1807

替换字符串中的括号内容

Quickly evaluate a string with bracketed keys using array scanning and hash table lookups for efficient replacements.

中等
1813

句子相似性 III

Sentence Similarity III asks if one sentence can be transformed into another by inserting a sentence inside it.

中等
1814

统计一个数组中好对子的数目

Count Nice Pairs in an Array requires efficiently pairing numbers where nums[i] + rev(nums[j]) equals nums[j] + rev(nums…

中等
1815

得到新鲜甜甜圈的最多组数

Reorder groups to maximize happy customers by using state transition dynamic programming with bitmasking for optimal bat…

困难
1816

截断句子

Truncate a sentence to contain only the first k words by converting it into an array of words.

简单
1817

查找用户活跃分钟数

This problem requires counting unique minutes of user activity on LeetCode based on a series of logs and an integer k.

中等
1818

绝对差值和

Minimize the absolute sum difference between two integer arrays by replacing at most one element from the first array.

中等
1819

序列中不同最大公约数的数目

Given an array of positive integers, find the number of different subsequences' GCDs.

困难
1822

数组元素积的符号

Determine the sign of a product from an integer array using a single pass without computing the full product.

简单
1823

找出游戏的获胜者

Find the winner of a circular game by simulating the elimination process with a queue-driven approach.

中等
1824

最少侧跳次数

Solve the Minimum Sideway Jumps problem using state transition dynamic programming to minimize side jumps while navigati…

中等
1827

最少操作使数组递增

Calculate the minimum number of increments required to transform a given integer array into a strictly increasing sequen…

简单
1828

统计一个圆中点的数目

Determine how many 2D points lie within multiple circles using array iteration and Euclidean distance calculations effic…

中等
1829

每个查询的最大异或值

Find the maximum XOR for each query based on a sorted array and bit manipulation.

中等
1833

雪糕的最大数量

Maximize the number of ice cream bars a boy can buy by applying a greedy choice strategy based on cost sorting.

中等
1834

单线程 CPU

Simulate task processing with a single-threaded CPU by sorting and prioritizing tasks based on arrival and processing ti…

中等
1835

所有数对按位与结果的异或和

Compute the XOR sum of all pairwise ANDs between two integer arrays using array and bitwise math techniques efficiently.

困难
1838

最高频元素的频数

Maximize the frequency of an element in an array by incrementing at most `k` elements. Use binary search and greedy tech…

中等
1840

最高建筑高度

Find the maximum building height in a city given height restrictions for specific buildings.

困难
1846

减小和重新排列数组后的最大元素

Determine the maximum value in an array after decreasing elements and rearranging using a greedy invariant approach.

中等
1847

最近的房间

Find the closest hotel room meeting minimum size requirements using binary search over the valid answer space efficientl…

困难
1848

到目标元素的最小距离

Solve Minimum Distance to the Target Element by scanning the array and tracking the smallest distance from start.

简单
1851

包含每个查询的最小区间

Find the smallest interval containing each query efficiently using binary search.

困难
1854

人口最多的年份

Find the earliest year with the highest population using an array plus counting approach.

简单
1855

下标对中的最大距离

Find the maximum distance between a pair of values in two non-increasing integer arrays using binary search.

中等
1856

子数组最小乘积的最大值

The problem asks to find the maximum min-product of any non-empty subarray of nums.

中等
1861

旋转盒子

Rotate a box represented by a character matrix, letting stones fall under gravity using precise two-pointer scanning and…

中等
1862

向下取整数对和

The problem asks to calculate the sum of floor divisions for all pairs in a given integer array, using an efficient meth…

困难
1863

找出所有子集的异或总和再求和

Compute the sum of all subset XOR totals using a backtracking search with pruning for arrays of small size.

简单
1865

找出和为指定值的下标对

Efficiently track and count pairs across two arrays using array scanning plus hash lookup to support dynamic updates.

中等
1870

准时到达的列车最小时速

This problem asks to find the minimum speed of trains to reach on time using binary search.

中等
1872

石子游戏 VIII

Stone Game VIII requires calculating maximum score difference using state transition dynamic programming on prefix sums …

困难
1877

数组中最大数对和的最小值

Minimize the maximum pair sum in an array by optimally pairing its elements.

中等
1878

矩阵中最大的三个菱形和

Find the three largest distinct rhombus sums from a given grid using array and math techniques.

中等
1879

两个数组最小的异或值之和

Minimize the XOR sum of two integer arrays by rearranging elements using dynamic programming and bit manipulation.

困难
1882

使用服务器处理任务

Assign tasks to servers efficiently using arrays and heaps, resolving ties by weight and index while tracking availabili…

中等
1883

准时抵达会议现场的最小跳过休息次数

Solve the problem of minimizing skips while traveling to arrive on time, using dynamic programming and state transitions…

困难
1886

判断矩阵经轮转后是否一致

Determine if a binary matrix can be transformed into another by rotating it 90 degrees multiple times.

简单
1887

使数组元素相等的减少操作次数

Find the minimum number of operations to make all array elements equal by reducing the largest elements to the next smal…

中等
1889

装包裹的最小浪费空间

Minimize the wasted space when packaging items into boxes, considering package and box size constraints.

困难
1893

检查是否区域内所有整数都被覆盖

Check if all integers in the range [left, right] are covered by intervals in a given set of ranges.

简单
1894

找到需要补充粉笔的学生编号

Identify the first student who will run out of chalk using a simulation with prefix sums and binary search.

中等
1895

最大的幻方

Find the side length of the largest magic square in a matrix where row, column, and diagonal sums are equal.

中等
1898

可移除字符的最大数目

Use binary search and a subsequence check to find the largest removable prefix that still keeps p inside s.

中等
1899

合并若干三元组以形成目标三元组

Determine if target triplet can be formed by merging given triplets using greedy selection and invariant checks.

中等
1901

寻找峰值 II

Locate any peak in a 2D matrix using binary search across rows or columns for efficient discovery and verification.

中等
1905

统计子岛屿

Identify and count all islands in grid2 that are fully contained within islands of grid1 using DFS traversal efficiently…

中等
1906

查询差绝对值的最小值

Compute minimum absolute differences for subarrays efficiently using array scanning and hash table lookups, leveraging b…

中等
1909

删除一个元素使数组严格递增

Determine if removing a single element from an array can make it strictly increasing, using a careful index check approa…

简单
1911

最大交替子序列和

Maximize alternating subsequence sum with dynamic programming and state transitions in an array.

中等
1912

设计电影租借系统

Implement a movie rental system with efficient search, rent, drop, and report operations using arrays and hash lookups.

困难
1913

两个数对之间的最大乘积差

Find the maximum product difference between two pairs in an integer array using sorting for optimal selection.

简单
1914

循环轮转矩阵

This problem requires cyclically rotating a grid by rotating each layer of the matrix counter-clockwise for a specified …

中等
1920

基于排列构建数组

The problem asks to build an array from a given permutation using an efficient approach.

简单
1921

消灭怪物的最大数量

Eliminate monsters by strategically using a weapon in a video game to stop them before they reach your city.

中等
1923

最长公共子路径

The Longest Common Subpath problem requires finding the longest subpath shared by all paths in a graph using binary sear…

困难
1926

迷宫中离入口最近的出口

Find the shortest path from the maze entrance to the nearest border exit using BFS over a 2D array matrix efficiently.

中等
1928

规定时间内到达终点的最小花费

Minimize the travel cost in a graph while adhering to a time constraint using state transition dynamic programming.

困难
1929

数组串联

This problem asks you to create an array of double the size, where each element is repeated twice in sequence.

简单
1936

新增的最少台阶数

Determine the fewest rungs to add to climb a strictly increasing ladder using a greedy step-by-step approach.

中等
1937

扣分后的最大得分

Maximize your points in a matrix by selecting cells row by row while accounting for distance penalties using dynamic pro…

中等
1938

查询最大基因差

Find the maximum genetic difference along paths in a tree using array scanning and hash lookups with XOR calculations.

困难
1942

最小未被占据椅子的编号

Solve The Number of the Smallest Unoccupied Chair by sorting arrivals and managing freed seats before each new assignmen…

中等
1943

描述绘画结果

Solve the problem of describing a painted segment with mixed colors using array scanning and hash table lookups.

中等
1944

队列中可以看到的人数

Compute how many people each person in a queue can see to their right using efficient stack-based state management.

困难
1946

子字符串突变后可能得到的最大整数

Find the largest integer by mutating a substring of a number using a mapping array for each digit.

中等
1947

最大兼容性评分和

Assign students to mentors to maximize total compatibility using state transition dynamic programming with bitmask optim…

中等
1948

删除系统中的重复文件夹

Solve Delete Duplicate Folders in System by building a trie, serializing child subtrees, and deleting repeated non-empty…

困难
1953

你可以工作的最大周数

Maximize the number of weeks you can work on projects with milestone constraints using a greedy approach and invariant v…

中等
1955

统计特殊子序列的数目

Learn to count all valid special subsequences in an array using state transition dynamic programming efficiently and cor…

困难
1958

检查操作是否合法

Determine if a move on an 8x8 board is legal by validating lines in all directions using array and matrix patterns.

中等
1959

K 次调整数组大小浪费的最小总空间

Find the minimum total space wasted in a dynamic array with at most k resizing operations.

中等
1961

检查字符串是否为数组前缀

Determine if a string is a prefix of an array by concatenating initial elements, using two-pointer scanning efficiently.

简单
1962

移除石子使总数最小

Minimize the total stones by repeatedly removing half from the largest pile using a greedy heap strategy.

中等
1964

找出到每个位置为止最长的有效障碍赛跑路线

Compute the longest valid obstacle course at each position using binary search and careful array tracking techniques eff…

困难
1967

作为子字符串出现在单词中的字符串数目

Count how many strings in an array appear as substrings within a given word by checking each pattern individually.

简单
1968

构造元素不等于两相邻元素平均值的数组

Rearrange an array such that no element equals the average of its neighbors using a greedy approach.

中等
1970

你能穿过矩阵的最后一天

Find the last day to walk from top to bottom in a flooded matrix by using binary search and graph traversal techniques.

困难
1975

最大方阵和

Maximize the sum of an n x n integer matrix using row and column negation operations efficiently with a greedy approach.

中等
1979

找出数组的最大公约数

Find the greatest common divisor of the smallest and largest numbers in an integer array.

简单
1980

找出不同的二进制字符串

Find a binary string of length n not in the input array using array scanning and hash lookup efficiently.

中等
1981

最小化目标值与所选元素的差

This problem asks to select one element per row to minimize the absolute difference from a target sum using dynamic prog…

中等
1982

从子集的和还原数组

Reconstruct an array from given subset sums using divide and conquer approach and leveraging array properties.

困难
1984

学生分数的最小差值

Minimize the difference between the highest and lowest of k student scores using a sliding window approach.

简单
1985

找出数组中的第 K 大整数

This problem asks to find the kth largest integer in an array of string numbers, highlighting sorting and string-based c…

中等
1986

完成任务的最少工作时间段

Find the minimum number of work sessions needed to finish a set of tasks, considering task durations and session time.

中等
1991

找到数组的中间位置

Find the smallest middle index where the sum of elements on the left equals the sum on the right using prefix sums effic…

简单
1992

找到所有的农场组

Identify all rectangular farmland groups in a binary matrix using array traversal and depth-first search efficiently.

中等
1993

树上的操作

Design a tree data structure that allows locking, unlocking, and upgrading nodes with user-specific actions.

中等
1994

好子集的数目

Find the number of good subsets in an integer array, where each subset's product is the product of distinct primes.

困难
1995

统计特殊四元组

Count Special Quadruplets requires scanning arrays and using hash lookups to efficiently find quadruplets matching sum c…

简单
1996

游戏中弱角色的数量

Identify all weak characters in a game by analyzing attack and defense values using a stack-based greedy sorting approac…

中等
1997

访问完所有房间的第一天

Calculate the first day you have visited all rooms using state transition dynamic programming on the nextVisit array.

中等
1998

数组的最大公因数排序

The GCD Sort problem challenges you to sort an array using a specific gcd-based swap method.

困难
2001

可互换矩形的组数

Count all pairs of rectangles that share the exact width-to-height ratio using efficient array scanning and hash lookup.

中等
2006

差的绝对值为 K 的数对数目

Find how many pairs (i, j) with i < j satisfy |nums[i] - nums[j]| == k using array scanning and hash lookup.

简单
2007

从双倍数组中还原原数组

Given a shuffled array, determine if it is a doubled array and find the original array.

中等
2008

出租车的最大盈利

Maximize earnings by optimizing taxi ride selection and tips using array scanning, hash lookups, and sorting.

中等
2009

使数组连续的最少操作数

Find the minimum number of operations to make an array continuous by modifying elements using array scanning and hash lo…

困难
2011

执行操作后的变量值

Compute the final value of X by simulating each string operation in the array sequentially with careful tracking.

简单
2012

数组美丽值求和

Calculate the sum of beauty for array elements using prefix and suffix tracking to optimize evaluation across indices ef…

中等
2013

检测正方形

Detect Squares requires tracking points on a 2D plane to quickly count all possible axis-aligned squares using efficient…

中等
2016

增量元素之间的最大差值

Find the maximum difference between two increasing elements in an array using a linear scan to track the minimum value e…

简单
2017

网格游戏

Solve the Grid Game problem by optimizing the movement of two robots on a 2D matrix grid.

中等
2018

判断单词是否能放入填字游戏内

Determine if a word fits in a crossword grid using array and matrix checks, accounting for spaces, letters, and blocked …

中等
2019

解出数学表达式的学生分数

Calculate student scores for a single-digit math expression using state transition dynamic programming to track all vali…

困难
2022

将一维数组转变成二维数组

Convert a 1D integer array into a structured 2D array with specified rows and columns using all elements sequentially.

简单
2023

连接后等于目标字符串的字符串对

Count all unique index pairs in a string array whose concatenation exactly matches the given target string using efficie…

中等
2025

分割数组的最多方案数

Determine the maximum number of ways to split an array into equal sums using at most one element change, leveraging pref…

困难
2028

找出缺失的观测数据

Given a set of dice rolls, calculate the missing observations based on the mean and return them or determine if it's imp…

中等
2029

石子游戏 IX

In the Stone Game IX problem, Alice and Bob take turns removing stones, and Alice wins if the sum of removed stones is d…

中等
2032

至少在两个数组中出现的值

Identify all elements appearing in at least two of three arrays using efficient scanning and hash lookups for fast verif…

简单
2033

获取单值网格的最小操作数

Determine the fewest additions or subtractions of x to make all grid elements identical using array and math logic.

中等
2035

将数组分成两个数组并最小化数组和的差

Partition an integer array into two equal halves to minimize the absolute difference of their sums using dynamic program…

困难
2037

使每位学生都有座位的最少移动次数

Calculate the minimum total moves to seat each student using greedy assignment and invariant validation efficiently.

简单
2039

网络空闲的时刻

Calculate the time when the network becomes idle, factoring in message resending and the BFS traversal method.

中等
2040

两个有序数组的第 K 小乘积

Find the kth smallest product from two sorted arrays using binary search across possible product values efficiently.

困难
2043

简易银行系统

Design a simple bank system that processes transactions like withdrawals, deposits, and transfers while managing account…

中等
2044

统计按位或能得到最大值的子集数目

Determine the number of non-empty subsets that achieve the maximum bitwise OR using efficient backtracking and pruning s…

中等
2049

统计最高分的节点数目

Find the number of nodes with the highest score in a binary tree, based on subtree sizes and node removal.

中等
2050

并行课程 III

Solve Parallel Courses III by finding the minimum number of months to complete all courses using graph-based topological…

困难
2053

数组中第 K 个独一无二的字符串

Find the kth distinct string in an array by identifying strings that appear only once, using efficient array scanning an…

简单
2054

两个最好的不重叠活动

Maximize the total value of at most two non-overlapping events using state transition dynamic programming efficiently.

中等
2055

蜡烛之间的盘子

Determine the number of plates between candles in a given substring using binary search and prefix sum techniques.

中等
2056

棋盘上有效移动组合的数目

Given a set of pieces on a chessboard, calculate the number of valid move combinations without overlap using backtrackin…

困难
2057

值相等的最小索引

Find the smallest index where the index mod 10 equals the value at that index in the given array.

简单
2059

转化数字的最小运算数

Determine the minimum operations needed to convert a number using array elements with addition, subtraction, or XOR oper…

中等
2064

分配给商店的最多商品的最小值

Distribute products to stores so the largest store allocation is minimized using binary search over possible maximums.

中等
2065

最大化一张图中的路径价值

Calculate the maximum path quality in a graph using backtracking and pruning to optimize node visits within time limits …

困难
2070

每一个查询的最大美丽值

Determine the maximum beauty of items affordable for each query using efficient binary search and sorting techniques.

中等
2071

你可以安排的最多任务数目

Maximize the number of tasks that can be completed by efficiently using workers and magical pills.

困难
2073

买票需要的时间

Calculate the total time for a specific person to buy all their tickets using queue-driven state processing.

简单
2078

两栋颜色不同且距离最远的房子

Maximize the distance between two houses with different colors by using a greedy approach and validating the choice.

简单
2079

给植物浇水

Simulate watering plants while managing a watering can's capacity, considering distance and refills.

中等
2080

区间内查询数字的频率

Design a data structure to handle efficient frequency queries for subarrays, focusing on hash-based lookups and efficien…

中等
2085

统计出现过一次的公共字符串

Learn how to efficiently count strings appearing exactly once in both arrays using array scanning and hash lookup patter…

简单
2087

网格图中机器人回家的最小代价

Find the minimum cost for a robot to return home in a grid with row and column movement costs.

中等
2088

统计农场中肥沃金字塔的数目

Solve Count Fertile Pyramids in a Land with matrix DP that measures the tallest pyramid rooted at each fertile cell.

困难
2089

找出数组排序后的目标下标

Find the target indices of a sorted array and return them in increasing order using binary search and sorting techniques…

简单
2090

半径为 k 的子数组平均值

Efficiently calculate the k-radius average for subarrays using sliding window technique.

中等
2091

从数组中移除最大值和最小值

The problem asks to remove the minimum and maximum elements from an array with the fewest deletions.

中等
2094

找出 3 位偶数

Generate unique 3-digit even numbers from a given array of digits with duplicates.

简单
2099

找到和最大的长度为 K 的子序列

Pick the k largest values, then restore their original order to build the maximum-sum subsequence correctly.

简单
2100

适合野炊的日子

Find good days to rob the bank by identifying days with non-increasing and non-decreasing guard counts using dynamic pro…

中等
2101

引爆最多的炸弹

Determine the maximum number of bombs that can be detonated by leveraging chain reactions using graph traversal and DFS …

中等
2104

子数组范围和

Compute the total sum of ranges for all contiguous subarrays efficiently using stack-based state management techniques.

中等
2105

给植物浇水 II

Simulate watering a row of plants with Alice and Bob using two-pointer scanning, tracking refills precisely for each ste…

中等
2106

摘水果

Compute the maximum fruits collectable on an infinite line by moving at most k steps from a start position efficiently.

困难
2108

找出数组中的第一个回文字符串

Return the first palindromic string from an array of words or an empty string if none exists.

简单
2109

向字符串添加空格

Learn to efficiently insert spaces in a string using two-pointer scanning with invariant tracking in linear time.

中等
2110

股票平滑下跌阶段的数目

Count all contiguous periods where stock prices descend smoothly by exactly one using dynamic programming techniques.

中等
2111

使数组 K 递增的最少操作次数

This problem requires finding the minimum number of operations to make an array K-increasing using binary search over th…

困难
2114

句子中的最多单词数

Find the maximum number of words in a single sentence from an array of sentences using array and string processing techn…

简单
2115

从给定原材料中找到所有可以做出的菜

Determine all recipes you can prepare given initial supplies and ingredient dependencies, leveraging array scanning and …

中等
2121

相同元素的间隔之和

Solve the problem of calculating intervals between identical elements using array scanning and hash lookup.

中等
2122

还原原数组

Recover the Original Array helps you understand how to reverse-engineer an array from two subsets using array scanning a…

困难
2125

银行中的激光束数量

Calculate total laser beams in a bank floor plan using array counting and math logic between security devices on differe…

中等
2126

摧毁小行星

This problem requires destroying asteroids by choosing the right order of collisions based on mass, using a greedy appro…

中等
2131

连接两字母单词得到的最长回文串

Find the maximum-length palindrome by combining two-letter words using array scanning and hash table lookups efficiently…

中等
2132

用邮票贴满网格图

Determine if a binary grid can be fully covered using fixed-size stamps by applying a greedy placement and validation st…

困难
2133

检查是否每一行每一列都包含全部整数

Determine if every row and column in a square matrix contains all numbers from 1 to n without repetition using array sca…

简单
2134

最少交换次数来组合所有的 1 II

Solve the minimum swaps to group all 1's together in a circular binary array using an optimized sliding window approach.

中等
2135

统计追加字母可以获得的单词数

Given startWords and targetWords, check how many targetWords can be formed by adding one letter and rearranging letters …

中等
2136

全部开花的最早一天

Find the earliest day where all flower seeds are blooming based on their planting and growth times, using a greedy strat…

困难
2140

解决智力问题

Maximize points in an exam with state transition dynamic programming by deciding whether to solve or skip each question.

中等
2141

同时运行 N 台电脑的最长时间

Solve the problem of determining the maximum running time of n computers using a set of batteries.

困难
2144

打折购买糖果的最小开销

Minimize the total cost of buying candies using a greedy approach with a discount system based on candy prices.

简单
2145

统计隐藏数组数目

Given a sequence of differences, count how many hidden sequences fit within a range using an array and prefix sum approa…

中等
2146

价格范围内最高排名的 K 样物品

Use BFS to rank reachable shop items by distance, price, row, and column, then return the best k coordinates.

中等
2148

元素计数

Count elements in an array that have both strictly smaller and strictly greater numbers using array sorting efficiently.

简单
2149

按符号重排数组

Rearrange an array by alternating positive and negative integers using a two-pointer approach with invariant tracking.

中等
2150

找出数组中的所有孤独数字

Find lonely numbers in an array where each lonely number appears once and has no adjacent values.

中等
2151

基于陈述统计最多好人数

Determine the maximum number of good people in a group given mutual statements, using precise backtracking with pruning.

困难
2154

将找到的值乘以 2

The "Keep Multiplying Found Values by Two" problem involves repeatedly multiplying a number by two if it is found in an …

简单
2155

分组得分最高的所有下标

Find all indices in a binary array where division score is maximized.

中等
2161

根据给定数字划分数组

Rearrange an array around a pivot while maintaining relative order using a two-pointer scanning approach efficiently.

中等
2163

删除元素后和的最小差值

Minimize the difference between sums after removing n elements from a 3n array by dividing the remaining elements into t…

困难
2164

对奇偶下标分别排序

Rearrange a 0-indexed array by sorting even and odd indices independently for predictable order and correctness.

简单
2166

设计位集

Master the Design Bitset problem by efficiently managing bit flips, counts, and indexed updates with array and hash look…

中等
2170

使数组变成交替数组的最少操作数

Given an array, calculate the minimum number of operations needed to make it alternating.

中等
2171

拿出最少数目的魔法豆

Determine the minimum beans to remove so all remaining non-empty bags have equal beans using a greedy approach.

中等
2172

数组的最大与和

Find the maximum AND sum by placing integers into limited slots using state transition dynamic programming efficiently.

困难
2176

统计数组中相等且可以被整除的数对

Given an array, count pairs of elements that are equal and their indices product is divisible by a given integer.

简单
2179

统计数组中好三元组数目

Count Good Triplets in an Array requires tracking index orders across two permutations efficiently using binary search.

困难
2183

统计可以被 K 整除的下标对数目

Count Array Pairs Divisible by K requires counting index pairs whose products are divisible by a given number k.

困难
2185

统计包含给定前缀的字符串

Count how many words in a list start with a given prefix.

简单
2187

完成旅途的最少时间

Find the minimum time required for buses to complete at least totalTrips using binary search over time multiples.

中等
2188

完成比赛的最少时间

Minimize the time to complete a race with tire swaps using dynamic programming and state transitions.

困难
2190

数组中紧跟 key 之后出现最频繁的数字

Scan the array once, count which value appears right after the key, and return the uniquely most frequent follower.

简单
2191

将杂乱无章的数字排序

Sort numbers based on a custom mapping of their digits, leveraging array manipulation and sorting techniques.

中等
2195

向数组中追加 K 个整数

In this problem, you need to append k unique positive integers to a given array nums such that the sum is minimized.

中等
2196

根据描述创建二叉树

Build a binary tree from descriptions of parent-child relationships using array scanning and hash lookup.

中等
2197

替换数组中的非互质数

Replace Non-Coprime Numbers in Array uses stack-based state management to iteratively merge adjacent non-coprime integer…

困难
2200

找出数组中的所有 K 近邻下标

Identify all indices in an array that are within k distance of elements equal to the given key using two-pointer scannin…

简单
2201

统计可以提取的工件

Count the number of artifacts that can be extracted after excavating specified grid cells.

中等
2202

K 次操作后最大化顶端元素

Maximize the topmost element in a pile after making exactly k moves using a greedy strategy and invariant checks.

中等
2206

将数组划分成相等数对

Determine if an array of 2n integers can be partitioned into n pairs where each pair contains identical elements using h…

简单
2208

将数组和减半的最少操作次数

Minimize operations to halve an array's sum using greedy choices and heap data structures.

中等
2210

统计数组中峰和谷的数量

Count Hills and Valleys in an Array determines the number of hills and valleys in a given array by analyzing index neigh…

简单
2212

射箭比赛中的最大得分

In the "Maximum Points in an Archery Competition" problem, Bob aims to maximize his score while respecting Alice's arrow…

中等
2213

由单个字符重复的最长子字符串

Solve Longest Substring of One Repeating Character by maintaining mergeable run information under character updates afte…

困难
2215

找出两数组的不同

Find the Difference of Two Arrays helps you identify unique elements between two integer arrays using array scanning and…

简单
2216

美化数组的最少删除数

Determine the minimum deletions required to transform an array into a beautiful sequence using stack-based state managem…

中等
2217

找到指定长度的回文数

Find the smallest palindromes of a given length for specific queries with mathematical and array manipulation.

中等
2218

从栈中取出 K 个硬币的最大面值和

Optimize coin selection across multiple piles using state transition dynamic programming to achieve the maximum wallet v…

困难
2221

数组的三角和

The problem asks for calculating the triangular sum of an array through repeated pairwise summation.

中等
2225

找出输掉零场或一场比赛的玩家

Identify players with zero or one losses by efficiently scanning arrays and counting losses using hash lookups for accur…

中等
2226

每个小孩最多能分到多少糖果

Maximize candies allocation for k children by dividing piles into sub-piles using binary search.

中等
2227

加密解密字符串

The 'Encrypt and Decrypt Strings' problem involves creating a data structure that can encrypt and decrypt strings using …

困难
2233

K 次增加后的最大乘积

Maximize the product of an array after performing up to k increments using a greedy approach with heap optimization.

中等
2234

花园的最大总美丽值

Determine the maximum total beauty of gardens by strategically planting flowers using binary search over achievable flow…

困难
2239

找到最接近 0 的数字

Identify the number in an integer array that is closest to zero, returning the larger one if tied.

简单
2241

设计一个 ATM 机器

Design an ATM machine that stores and withdraws money with given denominations and prioritizes larger values during with…

中等
2242

节点序列的最大得分

Find the maximum score of a valid node sequence in an undirected graph with given node scores and edges.

困难
2244

完成所有任务需要的最少轮数

The problem requires finding the minimum rounds to complete tasks, focusing on greedy algorithms and hash table lookups.

中等
2245

转角路径的乘积中最多能有几个尾随零

Find the maximum trailing zeros in the product of a cornered path within a 2D grid.

中等
2246

相邻字符不同的最长路径

Find the longest path in a tree where adjacent nodes have different characters using graph DFS and topological reasoning…

困难
2248

多个数组求交集

Find integers that are common across all arrays in a given list of arrays.

简单
2249

统计圆内格点数目

Count the number of lattice points inside at least one circle in a grid, based on given center and radius data.

中等
2250

统计包含每个点的矩形数目

Given a set of rectangles and points, determine how many rectangles contain each point.

中等
2251

花期内花的数目

Find the number of flowers in full bloom at the given times for a list of people.

困难
2255

统计是给定字符串前缀的字符串数目

Count Prefixes of a Given String is a problem that involves finding the number of string prefixes in an array that match…

简单
2256

最小平均差

Find the index with the minimum average difference in an array using prefix sums.

中等
2257

统计网格图中没有被保卫的格子数

Solve Count Unguarded Cells in the Grid by marking guard sight lines across a blocked matrix and counting untouched empt…

中等
2258

逃离火灾

Maximize the time you can stay at your starting position before moving to safely reach the safehouse while avoiding fire…

困难
2260

必须拿起的最小连续卡牌数

Solve Minimum Consecutive Cards to Pick Up by tracking each card's last index and minimizing duplicate spans during one …

中等
2261

含最多 K 个可整除元素的子数组

Count all distinct subarrays with at most k elements divisible by p using array scanning and hash lookup techniques effi…

中等
2267

检查是否有合法括号字符串路径

Check if there exists a valid parentheses string path in a given grid using state transition dynamic programming.

困难
2270

分割数组的方案数

Count all valid ways to split a 0-indexed integer array into two non-empty parts using array plus prefix sum logic effic…

中等
2271

毯子覆盖的最多白色砖块数

Solve Maximum White Tiles Covered by a Carpet by sorting intervals, checking optimal carpet starts, and counting full pl…

中等
2272

最大波动的子字符串

Find the largest variance possible in any substring of a given string using dynamic programming.

困难
2273

移除字母异位词后的结果数组

This problem requires removing adjacent anagrams from a list of words using an array scanning and hash lookup approach.

简单
2274

不含特殊楼层的最大连续楼层数

Find the maximum sequence of consecutive floors without any special floors using array sorting techniques efficiently.

中等
2275

按位与结果大于零的最长组合

Find the largest group of integers in an array whose bitwise AND is greater than zero using array scanning and hash look…

中等
2279

装满石头的背包的最大数量

Maximize the number of bags filled to capacity by distributing additional rocks using a greedy approach.

中等
2280

表示一个折线图的最少线段数

Determine the fewest lines needed to accurately connect stock price points in a line chart using array and math reasonin…

中等
2281

巫师的总力量和

The Sum of Total Strength of Wizards problem asks for the sum of the total strengths of all contiguous subarrays of wiza…

困难
2284

最多单词数的发件人

Find the sender with the largest total word count by scanning messages and tallying counts using a hash table efficientl…

中等
2289

使数组按非递减顺序排列

Determine the minimum steps to make an array non-decreasing using linked-list pointer manipulation and monotonic stack t…

中等
2290

到达角落需要移除障碍物的最小数目

Find the minimum obstacles to remove in a 2D grid to reach the bottom-right corner using BFS graph traversal techniques.

困难
2293

极大极小游戏

The Min Max Game problem requires simulating an array reduction process to find the last remaining number.

简单
2294

划分数组使最大差为 K

Find the minimum number of subsequences required such that the difference between the maximum and minimum value in each …

中等
2295

替换数组中的元素

Replace Elements in an Array involves applying a series of operations to replace values in an array with new ones based …

中等
2300

咒语和药水的成功对数

Count how many potions pair successfully with each spell using binary search over sorted potion strengths efficiently.

中等
2301

替换字符后匹配

Determine if a target substring can appear in a string after optional character replacements using given mappings effici…

困难
2302

统计得分小于 K 的子数组数目

Count all non-empty subarrays whose score, defined as sum times length, is strictly less than a given integer k efficien…

困难
2303

计算应缴税款总额

Calculate the total tax owed by iterating through sorted brackets and applying each rate incrementally to your income.

简单
2304

网格中的最小路径代价

Minimize the cost of a path in a grid while considering move costs for each step.

中等
2305

公平分发饼干

The problem focuses on fairly distributing cookies among children to minimize the maximum unfairness of the distribution…

中等
2306

公司命名

The "Naming a Company" problem requires determining the number of valid distinct company names from a list of name ideas…

困难
2312

卖木头块

Maximize your profit by cutting a wooden piece into smaller parts based on given prices and dimensions.

困难
2317

操作后的最大异或和

Maximize the bitwise XOR of an array after applying a special operation with non-negative integers multiple times.

中等
2319

判断矩阵是否是一个 X 矩阵

Check if a square matrix follows the X-Matrix pattern by validating diagonal and non-diagonal conditions.

简单
2321

拼接数组的最大分数

Maximize the score of two arrays by splicing and swapping a subarray using dynamic programming.

困难
2322

从树中删除边的最小分数

Compute the minimum score after removing two edges in a tree using DFS and XOR-based component tracking efficiently.

困难
2326

螺旋矩阵 IV

In this problem, you need to generate a matrix filled with values from a linked list in a spiral order.

中等
2328

网格图中递增路径的数目

Solve Number of Increasing Paths in a Grid by turning cell comparisons into a DAG and counting paths with topological DP…

困难
2332

坐上公交的最晚时间

Find the latest time to catch a bus based on departure times, passenger arrivals, and capacity using binary search over …

中等
2333

最小差值平方和

Calculate the minimum sum of squared differences between two arrays using limited modifications and binary search techni…

中等
2334

元素值大于变化阈值的子数组

Find the size of a subarray with all elements greater than threshold divided by length using stack-based state managemen…

困难
2335

装满杯子需要的最短总时长

Determine the minimum seconds to fill cups of cold, warm, and hot water using a greedy selection strategy and invariant …

简单
2341

数组能形成多少数对

Given an array, count how many pairs can be formed and how many leftovers remain after pairing.

简单
2342

数位和相等数对的最大和

Find the maximum sum of two numbers with equal digit sums in a given array of positive integers.

中等
2343

裁剪数字后查询第 K 小的数字

Solve the Query Kth Smallest Trimmed Number problem by efficiently trimming and sorting strings in an array to answer qu…

中等
2344

使数组可以被整除的最少删除次数

Find the minimum number of deletions to make the smallest element in nums divide all elements of numsDivide.

困难
2347

最好的扑克手牌

Determine the strongest poker hand from five cards using array scanning and hash table counting techniques efficiently.

简单
2348

全 0 子数组的数目

Given an array of integers, count the subarrays that consist entirely of 0s.

中等
2350

不可能得到的最短骰子序列

Find the shortest subsequence that cannot be formed from a sequence of dice rolls, with efficient array scanning and has…

困难
2352

相等行列对

Identify all pairs of rows and columns in a square matrix that contain identical elements in the same sequence efficient…

中等
2353

设计食物评分系统

Design a food rating system that tracks and updates ratings of foods, finding the highest rated items by cuisine.

中等
2354

优质数对的数目

Calculate the number of excellent pairs in an array using bit counting, hash sets, and efficient pair scanning technique…

困难
2357

使数组中所有元素都等于零

Minimize operations to make all array elements zero by subtracting equal amounts in each operation.

简单
2358

分组的最大数量

Determine the maximum number of ordered non-empty student groups for a competition using grades array analysis and binar…

中等
2363

合并相似的物品

Merge Similar Items combines values and weights from two lists, returning the result sorted by value.

简单
2364

统计坏数对的数目

Count the number of bad pairs in an array where the difference between indices and values does not match.

中等
2365

任务调度器 II

Complete tasks in the optimal number of days by considering breaks and task type constraints.

中等
2366

将数组排序的最少替换次数

Minimize the number of operations to make the array sorted in non-decreasing order by replacing elements with sums of tw…

困难
2367

等差三元组的数目

Count the number of arithmetic triplets in a given strictly increasing array with a specified difference.

简单
2368

受限条件下可到达节点的数目

In the 'Reachable Nodes With Restrictions' problem, find the maximum reachable nodes from node 0 in a tree while avoidin…

中等
2369

检查数组是否存在有效划分

This problem challenges you to determine if an array can be partitioned into valid subarrays using dynamic programming.

中等
2373

矩阵中的局部最大值

Find the largest value in every 3x3 submatrix of an n x n integer matrix efficiently using nested loops.

简单
2381

字母移位 II

Shift letters in a string using a sequence of range-based forward or backward operations efficiently with prefix sums.

中等
2382

删除操作后的最大子段和

Calculate the maximum segment sum after sequential removals using array plus union find for efficient merging of segment…

困难
2383

赢得比赛需要的最少训练时长

Find the minimum hours of training needed to beat all opponents in a competition based on energy and experience.

简单
2386

找出数组的第 K 大和

Find the K-Sum of an Array requires computing the kth largest subsequence sum in an array using sorting and heap techniq…

困难
2389

和有限的最长子序列

Find the maximum size of a subsequence from nums with a sum less than or equal to each query value.

简单
2391

收集垃圾的最少总时间

This problem asks you to find the minimum amount of time needed to collect all garbage in a city, focusing on array and …

中等
2392

给定条件下构造矩阵

Solve the matrix-building problem by using graph indegree and topological sorting to satisfy given row and column constr…

困难
2395

和相等的子数组

Find Subarrays With Equal Sum is solved by scanning adjacent pairs and storing each length-2 sum in a hash set.

简单
2397

被列覆盖的最多行数

Select exactly numSelect columns from a binary matrix to maximize rows where all ones are covered efficiently using back…

中等
2398

预算内的最多机器人数目

Determine the maximum number of consecutive robots you can operate without exceeding a given budget using efficient bina…

困难
2399

检查相同字母间的距离

Verify if each pair of identical letters in a string has the exact number of letters between them as specified in a dist…

简单
2401

最长优雅子数组

Find the length of the longest nice subarray where the bitwise AND of all pairs of elements in the subarray is zero.

中等
2402

会议室 III

Determine which meeting room holds the most meetings by simulating room assignments with precise time tracking.

困难
2404

出现最频繁的偶数元素

Identify the most frequent even element in an array using counting and hash lookup, handling ties by choosing the smalle…

简单
2406

将区间分为最少组数

Determine the minimum number of non-overlapping groups for a set of intervals using precise two-pointer scanning logic.

中等
2407

最长递增子序列 II

Determine the longest increasing subsequence in an array where consecutive elements differ by at most k using dynamic pr…

困难
2410

运动员和训练师的最大匹配数

Maximize the number of valid player-trainer matchings using two-pointer scanning and careful sorting strategy.

中等
2411

按位或最大的最小子数组长度

Find the smallest subarrays with the maximum bitwise OR for each starting index in an array.

中等
2412

完成所有交易的初始最少钱数

Find the minimum money required to complete all transactions in any order while considering cost and cashback.

困难
2416

字符串的前缀分数和

The 'Sum of Prefix Scores of Strings' problem involves calculating prefix scores for strings based on their occurrences …

困难
2418

按身高排序

Sort the People requires pairing names with heights and sorting them in descending height order efficiently using arrays…

简单
2419

按位与最大的最长子数组

Find the length of the longest subarray whose bitwise AND reaches the array's maximum value, combining array scanning wi…

中等
2420

找到所有好下标

Identify all indices in an array where the k-length prefix is non-increasing and the k-length suffix is non-decreasing.

中等
2421

好路径的数目

Count all good paths in a tree by scanning node values and using hash maps to track valid connections efficiently.

困难
2425

所有数对的异或和

Compute the overall bitwise XOR from all pairings between two arrays using efficient array and bit manipulation techniqu…

中等
2426

满足不等式的数对数目

Count pairs in two arrays satisfying a given inequality condition using binary search over the valid answer space.

困难
2428

沙漏的最大总和

Calculate the maximum sum of an hourglass in a 2D matrix using array traversal and submatrix evaluation techniques effic…

中等
2432

处理用时最长的那个任务的员工

Identify which employee spent the longest time on a task using an array-driven approach, analyzing each log entry effici…

简单
2433

找出前缀异或的原始数组

Find the original array from a given prefix XOR array using bitwise manipulation techniques.

中等
2435

矩阵中和能被 K 整除的路径

Compute all paths in a matrix where the sum of elements is divisible by k using state transition dynamic programming eff…

困难
2438

二的幂数组中查询范围内的乘积

The Range Product Queries of Powers problem requires calculating the product of powers of 2 for a range of queries on a …

中等
2439

最小化数组中的最大值

Minimize Maximum of Array involves finding the smallest possible maximum value after applying a series of operations on …

中等
2440

创建价值相同的连通块

Maximize the number of components in a tree with equal sums by carefully deleting edges using divisor-based logic.

困难
2441

与对应负数同时存在的最大正整数

Find the largest positive integer in an array such that its negative counterpart also exists.

简单
2442

反转之后不同整数的数目

This problem requires counting distinct integers after performing reverse operations on each integer in an array.

中等
2444

统计定界子数组的数目

Count all subarrays where the minimum and maximum match given bounds using efficient sliding window tracking techniques.

困难
2446

判断两个事件是否存在冲突

Compare two same-day time intervals and check whether their inclusive endpoints overlap after converting HH:MM strings i…

简单
2447

最大公因数等于 K 的子数组数目

Count the number of subarrays with GCD equal to a given value k from a list of integers.

中等
2448

使数组相等的最小开销

Find the minimum cost to make all elements of an array equal by using binary search over valid answers.

困难
2449

使数组相似的最少操作次数

Determine the minimum operations to make two arrays similar by adjusting pairs while respecting element frequencies and …

困难
2451

差值数组不同的字符串

Identify the one string in an array whose consecutive letter differences deviate from all others using array scanning pl…

简单
2452

距离字典两次编辑以内的单词

Identify all words in queries that can match dictionary entries with at most two character changes efficiently using arr…

中等
2453

摧毁一系列目标

Find the minimum seed value to destroy the most targets on a number line, using array scanning and hash lookup.

中等
2454

下一个更大元素 IV

Find the second greater integer for each element in an array using binary search and monotonic stack techniques.

困难
2455

可被三整除的偶数的平均值

Find the average of even numbers divisible by 3 from an array of positive integers.

简单
2456

最流行的视频创作者

Identify the most popular video creator by summing views and selecting their top-viewed video with array and hash patter…

中等
2458

移除子树后的二叉树高度

Compute the height of a binary tree efficiently after removing subtrees, using traversal and precomputed node state trac…

困难
2460

对数组执行操作

Transform an array by applying adjacent doubling operations and shifting zeros efficiently using two-pointer scanning te…

简单
2461

长度为 K 子数组中的最大和

Find the maximum sum of all distinct-element subarrays of length k using array scanning and hash lookup techniques.

中等
2462

雇佣 K 位工人的总代价

Optimize the total cost of hiring exactly k workers using a two-pointer approach with invariant tracking and priority qu…

中等
2463

最小移动总距离

Optimize the total distance traveled by robots to factories using dynamic programming, sorting, and state transitions.

困难
2465

不同的平均值数目

Calculate the number of unique averages formed by repeatedly pairing smallest and largest elements efficiently using has…

简单
2467

树上最大得分和路径

Solve the 'Most Profitable Path in a Tree' problem using graph traversal and depth-first search techniques to maximize A…

中等
2470

最小公倍数等于 K 的子数组数目

Find the number of subarrays in an array where the least common multiple (LCM) of the subarray equals a given integer k.

中等
2475

数组中不等三元组的数目

Count all triplets in a positive integer array where each element is distinct using scanning and hash lookup efficiently…

简单
2476

二叉搜索树最近节点查询

Solve the problem of finding closest nodes in a Binary Search Tree for multiple queries, efficiently handling each query…

中等
2482

行和列中一和零的差值

This problem requires computing a difference matrix based on the ones and zeros in each row and column of a binary matri…

中等
2488

统计中位数为 K 的子数组

Count the number of subarrays in a given array with median equal to a specified value k.

困难
2491

划分技能点相等的团队

Divide players into equal skill teams and return the sum of their chemistry, or -1 if impossible.

中等
2496

数组中字符串的最大值

The problem requires finding the maximum value of alphanumeric strings in an array based on length or numeric value.

简单
2497

图中最大星和

Find the maximum star sum in a graph with specific node values and edges, using greedy algorithms to select the optimal …

中等
2498

青蛙过河 II

Frog Jump II requires finding the minimal maximum jump length for a frog to traverse stones forward and backward efficie…

中等
2499

让数组不相等的最小总代价

Calculate the minimum cost to rearrange nums1 so that no element matches nums2 using optimal swaps and hash counting.

困难
2500

删除每行中的最大值

Calculate the total of removed maximum values from each row of a matrix, iterating until all columns are deleted efficie…

简单
2501

数组中最长的方波

Find the length of the longest subsequence where each element is a perfect square of its previous one.

中等
2502

设计内存分配器

Design a memory allocator that simulates allocation and deallocation of memory blocks.

中等
2503

矩阵查询可获得的最大分数

Solve the Maximum Number of Points From Grid Queries problem using two-pointer scanning and invariant tracking.

困难
2506

统计相似字符串对的数目

Count similar string pairs by converting each word into a character-set signature and counting matching signatures effic…

简单
2509

查询树中环的长度

Solve the problem of determining cycle lengths in a binary tree with added edges through queries.

困难
2511

最多可以摧毁的敌人城堡数目

Find the maximum number of enemy forts that can be captured by moving your army using two-pointer scanning with invarian…

简单
2512

奖励最顶尖的 K 名学生

Calculate top K student scores by scanning reports and using hash tables for positive and negative word lookups efficien…

中等
2515

到目标字符串的最短距离

Find the shortest distance to a target string in a circular array with either left or right movement options.

简单
2517

礼盒的最大甜蜜度

Maximize the tastiness of a candy basket by choosing k candies from a list of candy prices.

中等
2518

好分区的数目

Calculate the number of great partitions of an array using state transition dynamic programming with careful sum constra…

困难
2521

数组乘积中的不同质因数数目

Find the number of distinct prime factors in the product of an array of integers.

中等
2527

查询数组异或美丽值

Find the xor-beauty of an array by XORing the effective values of all possible triplets of indices.

中等
2528

最大化城市的最小电量

Determine the maximum minimum power a city can achieve by strategically adding power stations using binary search and pr…

困难
2529

正整数和负整数的最大计数

Compute the maximum count between positive and negative integers in a sorted array using efficient binary search countin…

简单
2530

执行 K 次操作后的最大分数

Maximize your score by applying exactly k operations on an array using greedy selection and heap optimization techniques…

中等
2532

过桥的时间

Time to Cross a Bridge involves simulating worker movements using arrays and heaps to determine when the last worker cro…

困难
2535

数组元素和与数字和的绝对差

Find the absolute difference between element sum and digit sum of an array of integers.

简单
2536

子矩阵元素加 1

Increment Submatrices by One focuses on efficiently updating submatrices using row-wise prefix sums in an n by n matrix.

中等
2537

统计好子数组的数目

Count the number of subarrays that contain at least k pairs of equal elements using array scanning and hash lookup.

中等
2538

最大价值和与最小价值和的差值

Compute the maximum difference between any path price sum in a tree using binary-tree traversal and state tracking effic…

困难
2540

最小公共值

Find the smallest integer appearing in both sorted arrays efficiently using array scanning and hash-based lookup techniq…

简单
2541

使数组中所有元素相等的最小操作数 II

Calculate the minimum operations to make two integer arrays equal using greedy adjustments with modular checks efficient…

中等
2542

最大子序列的分数

Maximize the score of a subsequence by selecting indices based on nums1 and nums2, using a greedy approach and sorting.

中等
2545

根据第 K 场考试的分数排序

Sort a matrix of student scores by the kth exam efficiently using array manipulation and custom sorting techniques.

中等
2547

拆分数组的最小代价

Minimize the cost of splitting an array into k subarrays by calculating importance values and applying dynamic programmi…

困难
2549

统计桌面上的不同数字

Compute the number of distinct integers generated on a board using repeated modulo operations over a long sequence of da…

简单
2551

将珠子放入背包中

The "Put Marbles in Bags" problem challenges you to distribute marbles into bags for maximum score difference using gree…

困难
2552

统计上升四元组

Given a permutation of numbers, count the number of increasing quadruplets using dynamic programming.

困难
2553

分割数组中数字的数位

Given an array of positive integers, separate each integer into its individual digits while preserving the original orde…

简单
2554

从一个范围内选择最多整数 I

Determine the maximum count of integers from 1 to n avoiding banned numbers while keeping the sum under maxSum.

中等
2555

两个线段获得的最多奖品

Maximize the total prizes by choosing two segments of length k on a sorted line of prize positions efficiently using bin…

中等
2556

二进制矩阵中翻转最多一次使路径不连通

Determine if a single cell flip can disconnect a path from the top-left to bottom-right in a binary matrix efficiently u…

中等
2558

从数量最多的堆取走礼物

Take Gifts From the Richest Pile uses a heap to simulate the process of taking gifts from the richest pile over a number…

简单
2559

统计范围内的元音字符串数

Count the number of strings that start and end with a vowel in given ranges within an array of words.

中等
2560

打家劫舍 IV

House Robber IV requires calculating minimum maximum money the robber can take using state transition dynamic programmin…

中等
2561

重排水果

Solve the problem of rearranging fruit baskets by comparing fruit costs and minimizing swaps using array scanning and ha…

困难
2562

找出数组的串联值

Compute the array concatenation value efficiently using two-pointer scanning while maintaining a running total of concat…

简单
2563

统计公平数对的数目

Efficiently count all fair pairs in an array using sorting and binary search, focusing on the sum range between lower an…

中等
2564

子字符串异或查询

Solve the Substring XOR Queries problem using array scanning and hash lookup to efficiently handle multiple queries on b…

中等
2567

修改两个元素的最小分数

The problem asks for the minimum score after changing two elements of an array using a greedy approach.

中等
2568

最小无法得到的或值

Find the smallest positive integer that cannot be formed from any subsequence OR combination in the array.

中等
2569

更新数组后处理求和查询

Solve the Handling Sum Queries After Update problem using arrays and segment trees with lazy propagation for efficiency.

困难
2570

合并两个二维数组 - 求和法

Merge two 2D arrays by summing values with matching ids using array scanning and hash lookup efficiently.

简单
2572

无平方子集计数

Learn how to efficiently count square-free subsets using state transition dynamic programming with bitmask optimizations…

中等
2573

找出对应 LCP 矩阵的字符串

Determine the lexicographically smallest string matching a given LCP matrix using state transition dynamic programming.

困难
2574

左右元素和的差值

Compute absolute differences between left and right cumulative sums for each element in an integer array efficiently.

简单
2575

找出字符串的可整除数组

Calculate the divisibility array for a string by checking if prefixes are divisible by a given number.

中等
2576

求出最多标记下标

Maximize marked indices in an array by performing allowed operations, applying binary search to find the optimal count e…

中等
2577

在网格图中访问一个格子的最少时间

Compute the fastest path in a grid where each cell has a minimum time requirement using BFS and priority queue technique…

困难
2580

统计将重叠区间合并成组的方案数

Count Ways to Group Overlapping Ranges is a medium difficulty problem focused on array manipulation and sorting to count…

中等
2581

统计可能的树根数目

Given a tree and a set of guesses, find how many nodes can be the root while satisfying the guess constraints.

困难
2584

分割数组使乘积互质

Find the smallest index to split an array so that the products of two parts are coprime using array scanning and hash lo…

困难
2585

获得分数的方法数

Find the number of ways to earn exactly target points using multiple types of exam questions with distinct marks.

困难
2586

统计范围内的元音字符串数

Count the Number of Vowel Strings in Range asks to count vowel strings in a subarray of a given word list.

简单
2587

重排数组以得到最大前缀分数

Maximize the number of positive prefix sums by rearranging an integer array using a greedy, order-focused strategy.

中等
2588

统计美丽子数组数目

Count the Number of Beautiful Subarrays is a Medium-level problem involving array scanning and hash table lookup to find…

中等
2589

完成所有任务的最少时间

Determine the minimum active time for a computer to complete all scheduled tasks within their specific time windows effi…

困难
2592

最大化数组的伟大值

Maximize Greatness of an Array requires permuting numbers to exceed original values at most indices efficiently.

中等
2593

标记所有元素后数组的分数

The problem involves marking elements in an array and calculating the score based on adjacent elements.

中等
2594

修车的最少时间

Find the minimum time to repair all cars using mechanics with different ranks, applying binary search over possible time…

中等
2596

检查骑士巡视方案

Validate a knight's movement configuration on an n x n chessboard to check if it forms a valid Knight's Tour.

中等
2597

美丽子集的数目

Count all non-empty subsets of an array where no two numbers have an absolute difference equal to k, using array scannin…

中等
2598

执行操作后的最大 MEX

Find the smallest missing non-negative integer after repeated additions or subtractions of a given value in nums array e…

中等
2601

质数减法运算

Determine if it's possible to make the array strictly increasing using prime subtractions.

中等
2602

使数组元素全部相等的最少操作次数

Find the minimum number of operations to make all elements in an array equal for each query.

中等
2603

收集树中金币

The "Collect Coins in a Tree" problem requires traversing a tree to collect coins in the fewest steps while returning to…

困难
2605

从两个数字数组里生成最小数字

Given two arrays of digits, find the smallest possible number formed by one digit from each array.

简单
2606

找到最大开销的子字符串

Find the Substring With Maximum Cost requires calculating substring values using a hash lookup for character costs, with…

中等
2607

使子数组元素和相等

Solve Make K-Subarray Sums Equal by grouping circular indices with gcd cycles and minimizing each group to its median.

中等
2610

转换二维数组

Learn how to convert an integer array into a 2D array with distinct rows using array scanning plus hash lookup efficient…

中等
2611

老鼠和奶酪

In 'Mice and Cheese', you must maximize the total reward of two mice eating cheese while respecting their preferences an…

中等
2612

最少翻转操作数

Find the minimum number of operations to move a 1 in an array from a given start position to other positions, considerin…

困难
2614

对角线上的质数

Find the largest prime number located on any diagonal of a square matrix using array iteration and prime checking techni…

简单
2615

等值距离和

In this problem, you calculate an array where each element is the sum of absolute differences of indices for equal value…

中等
2616

最小化数对的最大差值

Minimize the Maximum Difference of Pairs seeks to optimize the maximum pairwise difference in a set of index pairs from …

中等
2617

网格图中最少访问的格子数

Determine the minimum number of cells to visit in a grid using state transition dynamic programming and efficient traver…

困难
2639

查询网格图中每一列的宽度

This problem asks you to compute the width of each column in a grid, where the width is defined by the length of the lar…

简单
2640

一个数组所有前缀的分数

Compute the score of each prefix in an array using conversion rules while tracking the maximum efficiently for prefix su…

中等
2643

一最多的行

Find the row with the maximum ones in a binary matrix and return its index and count.

简单
2644

找出可整除性得分最大的整数

Determine the divisor with the highest count of divisible elements in an array using a clear array-driven strategy.

简单
2646

最小化旅行的价格总和

Calculate the minimum total cost of multiple trips on a tree by selectively halving node prices using DFS frequency coun…

困难
2653

滑动子数组的美丽值

Compute the xth smallest negative number in each sliding subarray using array scanning and hash frequency tracking effic…

中等
2654

使数组所有元素变成 1 的最少操作次数

Find the minimum number of operations to transform every element of a positive integer array into 1 using gcd operations…

中等
2656

K 个元素的最大和

Maximize your score by performing exactly k operations on an array using a greedy approach to select the highest values.

简单
2657

找到两个数组的前缀公共数组

This problem challenges you to find the prefix common array of two integer permutations, utilizing array scanning and ha…

中等
2658

网格图中鱼的最大数目

Maximize the number of fish that can be caught by performing DFS on an optimal starting point in a grid.

中等
2659

将数组清空

Solve the "Make Array Empty" problem using binary search to determine the minimum number of operations required.

困难
2660

保龄球游戏的获胜者

Simulate a bowling game to determine the winner based on hit pins per turn for two players.

简单
2661

找出叠涂元素

Find the first index where a row or column is completely painted in a matrix based on an array of integers.

中等
2662

前往目标的最小代价

Find the minimum cost path between two points, using special roads or direct moves in a 2D space.

中等
2670

找出不同元素数目差数组

Calculate the distinct difference array of a given list of integers by counting distinct elements in the prefix and suff…

简单
2672

有相同颜色的相邻元素数目

Calculate the number of adjacent elements sharing the same color after sequentially updating an initially zeroed array u…

中等
2673

使二叉树所有路径值相等的最小代价

Minimize the cost increments required to equalize path costs in a binary tree from root to leaves.

中等
2678

老人的数目

Determine how many passengers are over 60 years old based on their compressed details in an array of strings.

简单
2679

矩阵中的和

Calculate the maximum score by repeatedly removing the largest elements from each row of a 2D matrix efficiently using s…

中等
2680

最大或值

Maximize the bitwise OR of an array by applying at most k multiplication operations on selected elements.

中等
2681

英雄的力量

Calculate the total power of all non-empty hero groups using state transition dynamic programming efficiently with sorti…

困难
2682

找出转圈游戏输家

Simulate a ball-passing game around a circle using array scanning and hash lookup to find friends who never receive the …

简单
2683

相邻值的按位异或

Determine if a binary array original exists that produces the given derived array using neighboring bitwise XOR logic.

中等
2684

矩阵中移动的最大次数

Maximize the number of moves in a grid starting from the first column using state transition dynamic programming.

中等
2706

购买两块巧克力

Determine the leftover money after buying exactly two chocolates using a greedy selection and sum validation approach.

简单
2707

字符串中的额外字符

The problem asks for the minimum number of extra characters left after optimally breaking a string into substrings found…

中等
2708

一个小组的最大实力值

Maximize the strength of a student group by carefully selecting students based on their scores, using dynamic programmin…

中等
2709

最大公约数遍历

Determine if every index in an array can be reached from any other using traversals based on greatest common divisors.

困难
2711

对角线上不同值的数量差

Find the difference in the number of distinct diagonal values in a matrix, returning results in a new matrix.

中等
2713

矩阵中严格递增的单元格数

Find the maximum number of cells that can be visited in a matrix by following strictly increasing values from a starting…

困难
2717

半有序排列

Find the minimum number of operations to convert a permutation into a semi-ordered permutation where 1 is first and n is…

简单
2718

查询后矩阵的和

Calculate the total sum of a zero-filled n x n matrix after sequentially applying row and column update queries efficien…

中等
2731

移动机器人

Calculate total distances between robots moving on a number line while accounting for collisions using array plus braint…

中等
2732

找到矩阵中的好子集

Find a Good Subset of the Matrix is a challenging problem involving array scanning, hash lookup, and bit manipulation to…

困难
2733

既不是最小值也不是最大值

Find a number in an array that is neither the minimum nor maximum value, or return -1 if no such number exists.

简单
2735

收集巧克力

Calculate the minimum cost to collect all chocolate types using rotations and purchases in an array-based enumeration pa…

中等
2736

最大和查询

Find the maximum sum of paired elements from two arrays under query constraints using efficient binary search techniques…

困难
2740

找出分区值

Find the minimum partition value by dividing a positive integer array into two subarrays using sorting for efficiency.

中等
2741

特别的排列

Count the number of special permutations for a given array using dynamic programming and bit manipulation.

中等
2742

给墙壁刷油漆

Compute the minimum cost to paint all walls using a paid and free painter with state transition dynamic programming.

困难
2744

最大字符串配对数目

Find the maximum number of pairs of distinct strings from an array where one string is the reverse of the other.

简单
2746

字符串连接删减字母

Solve the Decremental String Concatenation problem by applying dynamic programming to minimize string length after conca…

中等
2747

统计没有收到请求的服务器数目

Count Zero Request Servers finds the number of servers with zero requests during specific time intervals for a given set…

中等
2748

美丽下标对的数目

Count all index pairs in an array where the first digit of one number and last digit of another are coprime efficiently.

简单
2750

将数组划分成若干好子数组的方式

Calculate the number of ways to partition a binary array into good subarrays using state transition dynamic programming …

中等
2751

机器人碰撞

Robot Collisions involves simulating robot movements and handling collisions with stack-based state management.

困难
2760

最长奇偶子数组

Determine the length of the longest subarray where elements alternate even and odd while staying below a given threshold…

简单
2761

和等于目标值的质数对

Find all prime number pairs that sum up to a given integer n using an efficient sieve-based array approach.

中等
2762

不间断子数组

Count all continuous subarrays efficiently using sliding window with running max-min state tracking for array consistenc…

中等
2763

所有子数组中不平衡数字之和

Learn how to compute the total imbalance across all subarrays by updating gap counts as each subarray expands.

困难
2765

最长交替子数组

Find the longest alternating subarray in a given array of integers.

简单
2766

重新放置石块

Relocate marbles to new positions in an array by simulating moves, and return sorted occupied positions.

中等
2768

黑格子的数目

Calculate the number of black blocks in a grid given a list of black cell coordinates.

中等
2770

达到末尾下标所需的最大跳跃次数

Find the maximum number of jumps to reach the last index using state transition dynamic programming efficiently in array…

中等
2771

构造最长非递减子数组

Maximize the length of a non-decreasing subarray by optimally choosing elements from two arrays using dynamic programmin…

中等
2772

使数组中的所有元素都等于零

Determine if all elements in a given array can be reduced to zero using repeated k-length prefix operations efficiently.

中等
2778

特殊元素平方和

Calculate the sum of squares of special elements in a 1-indexed array using index divisibility checks efficiently.

简单
2779

数组的最大美丽值

Find the maximum beauty of an array by adjusting elements within a range using binary search and sliding window techniqu…

中等
2780

合法分割的最小下标

Find the minimum index to split an array such that both subarrays have the same dominant element.

中等
2781

最长合法子字符串的长度

This problem asks for the longest valid substring of a word that doesn't contain any substrings from a forbidden list.

困难
2784

检查数组是否是好的

Determine if a given integer array is a permutation of base[n], containing 1 to n-1 once and n twice, using scanning and…

简单
2786

访问数组中的位置使分数最大

Maximize your score by visiting positions in an array while handling penalties for parity changes efficiently with DP.

中等
2788

按分隔符拆分字符串

Split Strings by Separator requires iterating through an array of strings and splitting each by a given separator charac…

简单
2789

合并后数组中的最大元素

This problem focuses on applying greedy choices and merging elements to find the largest element in an array.

中等
2790

长度递增组的最大数目

Maximize the number of groups that can be formed with given usage limits, leveraging binary search for optimal solutions…

困难
2798

满足目标工作时长的员工数目

Determine how many employees reach the required work hours using a direct array-driven counting approach.

简单
2799

统计完全子数组的数目

Count Complete Subarrays in an Array requires scanning the array while tracking elements to detect subarrays with all di…

中等
2808

使循环数组所有元素相等的最少秒数

Find the minimum number of seconds to equalize a circular array using array scanning and hash lookup techniques.

中等
2809

使数组和小于等于 x 的最少时间

Calculate the minimum seconds to reduce the array sum to at most x using optimal single-time reductions per index effici…

困难
2811

判断是否能拆分数组

Determine whether an array can be fully split into single-element subarrays using a state transition dynamic programming…

中等
2812

找出最安全路径

Find the Safest Path in a Grid uses binary search and BFS to maximize path safeness from thieves in a grid.

中等
2813

子序列最大优雅度

Maximize elegance of a k-length subsequence from a list of items with profits and categories.

困难
2815

数组中的最大数对和

Find the maximum sum of two numbers in an array sharing the same largest digit using a hash-based scan efficiently.

简单
2817

限制条件下元素之间的最小绝对差

Find the minimum absolute difference between two array elements that are at least x indices apart using binary search.

中等
2818

操作使得分最大

Maximize the score by applying operations on a subarray at most k times, utilizing stack-based state management.

困难
2824

统计和小于目标的下标对数目

This problem asks you to count all index pairs in an array whose sum is strictly less than a given target value efficien…

简单
2826

将三个组排序

Determine the minimum removals to make an array of 1s, 2s, and 3s non-decreasing using dynamic programming transitions.

中等
2828

判别首字母缩略词

Check if a string can be formed by concatenating the first letters of each word in a given list.

简单
2830

销售利润最大化

Determine the maximum profit a salesman can earn by strategically selecting non-overlapping offers on consecutive houses…

中等
2831

找出最长等值子数组

Find the maximum length of an equal subarray after removing up to k elements using array scanning and hash-based index t…

中等
2835

使子序列的和等于目标的最少操作次数

The problem requires finding the minimum number of operations to form a subsequence summing to a target using powers of …

困难
2836

在传球游戏中最大化函数值

Maximize the total score in a ball-passing game by selecting the best starting player using state transition dynamic pro…

困难
2841

几乎唯一子数组的最大和

Find the maximum sum of subarrays that contain at least m distinct elements using array scanning and hash lookups effici…

中等
2845

统计趣味子数组的数目

Count all subarrays where the number of elements satisfying a modulo condition equals a target k using efficient prefix …

中等
2846

边权重均等查询

Find the minimum number of operations to equalize edge weights in a tree between given pairs of nodes.

困难
2848

与车相交的点

Count covered integer points by merging overlapping car intervals or marking visited positions on the number line.

简单
2850

将石头分散到网格图的最少移动次数

Solve the problem of distributing 9 stones across a 3x3 grid with minimal moves using state transition dynamic programmi…

中等
2855

使数组成为递增数组的最少右移次数

Determine the minimum number of right shifts to sort a distinct integer array or return -1 if impossible using array ana…

简单
2856

删除数对后的最小数组长度

This problem involves minimizing the length of a sorted array by repeatedly removing adjacent pairs of equal elements.

中等
2857

统计距离为 k 的点对

Solve the problem of counting pairs of points with distance k using array scanning and hash table techniques.

中等
2859

计算 K 置位下标对应元素的和

Sum values in an array where the indices have exactly k set bits in binary representation.

简单
2860

让所有学生保持开心的分组方法数

The Happy Students problem asks how many ways a teacher can select a group of students so everyone is happy, based on ce…

中等
2861

最大合金数

Determine the maximum number of alloys possible using limited metal stock and budget, leveraging binary search efficient…

中等
2862

完全子集的最大元素和

Given a 1-indexed array, select a subset where indices' product is a perfect square, then return the maximum sum.

困难
2865

美丽塔 I

Solve Beautiful Towers I by testing each peak and enforcing mountain limits with monotonic stack style height propagatio…

中等
2866

美丽塔 II

Maximize tower configurations with the stack-based approach while ensuring mountain-like patterns in this medium difficu…

中等
2869

收集元素的最少操作次数

Scan from the end, track seen values from 1 to k, and stop once every required number is collected.

简单
2870

使数组为空的最少操作次数

Minimize the number of operations to make an array empty by leveraging array scanning and hash lookup.

中等
2871

将数组分割成最多数目的子数组

Maximize the number of subarrays in an array while ensuring each subarray's bitwise AND meets the minimum score requirem…

中等
2873

有序三元组中的最大值 I

Find the maximum value of a triplet in an array where indices follow the order i < j < k.

简单
2874

有序三元组中的最大值 II

Solve Maximum Value of an Ordered Triplet II in linear time by tracking the best left difference and right multiplier.

中等
2875

无限数组的最短子数组

Find the shortest subarray in an infinite array that sums to a given target using array scanning and hash lookup.

中等
2895

最小处理时间

Determine the minimum total processing time by optimally assigning tasks to multiple processors using a greedy approach.

中等
2897

对数组执行操作使平方和最大

Maximizing the sum of squares in an array through bitwise operations on selected elements.

困难
2899

上一个遍历的整数

This problem involves finding the last visited integer for each -1 in a given array by simulating a stack-like behavior.

简单
2900

最长相邻不相等子序列 I

Find the longest alternating subsequence in a string array based on a binary group array.

简单
2901

最长相邻不相等子序列 II

Find the longest subsequence of indices such that the corresponding strings have a valid Hamming distance and group cons…

中等
2902

和带限制的子多重集合的数目

This problem asks you to count the number of sub-multisets within a given array that have a sum in a specified range.

困难
2903

找出满足差值条件的下标 I

Find two indices in an array where their difference in both index and value meets specified thresholds.

简单
2905

找出满足差值条件的下标 II

Locate two indices in an array where both index and value differences meet specified thresholds using precise scanning t…

中等
2906

构造乘积矩阵

Solve the "Construct Product Matrix" problem by calculating the product of elements in 2D matrices without division.

中等
2908

元素和最小的山形三元组 I

Find the minimum sum of a mountain triplet in an array of integers, or return -1 if no valid triplet exists.

简单
2909

元素和最小的山形三元组 II

Find the minimum sum of a valid mountain triplet in an integer array, or return -1 if no valid triplet exists.

中等
2910

合法分组的最少组数

The problem involves sorting balls into boxes while minimizing the number of boxes, adhering to size constraints.

中等
2913

子数组不同元素数目的平方和 I

Compute the sum of squares of distinct elements for all subarrays using array scanning with hash lookups efficiently.

简单
2915

和为目标值的最长子序列的长度

Find the length of the longest subsequence in an array that sums to a target value, using dynamic programming.

中等
2916

子数组不同元素数目的平方和 II

Compute the sum of squares of distinct elements in all subarrays using state transition dynamic programming efficiently.

困难
2917

找出数组中的 K-or 值

Given an integer array nums and an integer k, find the K-or of nums where bits qualify based on the occurrence of 1s.

简单
2918

数组的最小相等和

Find the minimum sum where two arrays become equal after replacing all zeros with positive integers using a greedy strat…

中等
2919

使数组变美的最小增量运算数

Optimize the number of increment operations to make an array beautiful by ensuring subarrays of size 3 or more meet the …

中等
2920

收集所有金币可获得的最大积分

Find the maximum points after collecting coins from all nodes of a tree using binary-tree traversal and state tracking.

困难
2923

找到冠军 I

Find Champion I is an easy problem focusing on identifying the strongest team in a tournament using matrix-based compari…

简单
2926

平衡子序列的最大和

Learn to find the maximum sum of a balanced subsequence using dynamic programming and careful state transitions efficien…

困难
2931

购买物品的最大开销

Maximize spending by carefully choosing the right items across multiple shops over m * n days.

困难
2932

找出强数对的最大异或值 I

Find the maximum XOR of any strong pair in an integer array using array scanning and hash-based lookups efficiently.

简单
2933

高访问员工

Identify employees with high system access within one-hour periods based on access logs.

中等
2934

最大化数组末位元素的最少操作次数

Minimize the number of operations needed to maximize the last elements of two arrays with specific swaps.

中等
2935

找出强数对的最大异或值 II

Find the maximum XOR among strong pairs in an array using array scanning and hash-based lookups efficiently.

困难
2940

找到 Alice 和 Bob 可以相遇的建筑

Determine the leftmost building where Alice and Bob can meet using a binary search over valid move sequences.

困难
2942

查找包含给定字符的单词

Identify all indices of words containing a specific character using array and string traversal techniques efficiently.

简单
2943

最大化网格图中正方形空洞的面积

Learn how to maximize the area of a square-shaped hole by selectively removing horizontal and vertical bars efficiently …

中等
2944

购买水果需要的最少金币数

Calculate the minimum coins to buy fruits using state transition dynamic programming while handling rewards and purchase…

中等
2945

找到最大非递减数组的长度

Solve Find Maximum Non-decreasing Array Length with prefix-sum DP transitions that maximize kept segments while preservi…

困难
2946

循环移位后的矩阵相似检查

Determine if a matrix returns to its original state after performing cyclic row shifts k times using array and math patt…

简单
2948

交换得到字典序最小的数组

Solve the problem of making an array lexicographically smallest through element swaps under a limit constraint.

中等
2951

找出峰值

Identify all peaks in a mountain array using direct array enumeration and strict neighbor comparisons efficiently.

简单
2952

需要添加的硬币的最小数量

Determine the minimum number of coins to add so all values up to target are obtainable using a greedy sum approach.

中等
2954

统计感冒序列的数目

Calculate all valid infection sequences in a line by using array positions and combinatorial math efficiently for n peop…

困难
2956

找到两个数组中的公共元素

Quickly find all numbers that appear in both arrays using scanning and hash lookup to handle duplicates efficiently.

简单
2958

最多 K 个重复元素的最长子数组

Find the maximum length subarray where each number appears at most k times using array scanning and hash lookups.

中等
2960

统计已测试设备

Simulate testing devices based on battery percentages to determine how many pass the test operations in sequence.

简单
2961

双模幂运算

Solve the Double Modular Exponentiation problem by applying array manipulation and modular arithmetic to find good indic…

中等
2962

统计最大元素出现至少 K 次的子数组

Find the number of subarrays where the maximum element appears at least k times using a sliding window approach.

中等
2963

统计好分割方案的数目

Calculate how many ways to partition an array into contiguous subarrays where no number repeats across segments using ha…

困难
2965

找出缺失和重复的数字

Find the missing and repeated numbers in an n x n grid using array scanning and hash lookup.

简单
2966

划分数组并满足最大差限制

Divide an array into subarrays with a maximum element difference under a given threshold using a greedy approach.

中等
2967

使数组成为等数数组的最小代价

Determine the minimum cost to convert an integer array into a palindromic array using allowed element modifications effi…

中等
2968

执行操作使频率分数最大

Maximize the frequency score by applying up to k operations on a sorted array using binary search over valid answer spac…

困难
2970

统计移除递增子数组的数目 I

Count the number of incremovable subarrays in an array by removing them to create a strictly increasing sequence.

简单
2971

找到最大周长的多边形

Determine the largest perimeter polygon from a set of side lengths using a greedy approach with invariant validation che…

中等
2972

统计移除递增子数组的数目 II

Count the number of incremovable subarrays where removal of the subarray results in a strictly increasing array.

困难
2974

最小数字游戏

The Minimum Number Game involves simulating moves by Alice and Bob on an array, sorting elements and appending them to a…

简单
2975

移除栅栏得到的正方形田地的最大面积

This problem challenges you to calculate the largest square area possible by removing fences from a given rectangular fi…

中等
2976

转换字符串的最小成本 I

This problem asks to calculate the minimum cost to convert a string from source to target using specific character trans…

中等
2977

转换字符串的最小成本 II

Compute the minimum cost to transform source into target using substring replacements with given costs efficiently using…

困难
2980

检查按位或是否存在尾随零

Check if a bitwise OR of two or more numbers has trailing zeros in its binary representation.

简单
2996

大于等于顺序前缀和的最小缺失整数

Find the smallest missing integer greater than the sum of the longest sequential prefix in an array.

简单
2997

使数组异或和等于 K 的最少操作次数

Find the minimum number of operations to make the XOR of an array equal to a given value k by modifying array elements.

中等
3000

对角线最长的矩形的面积

Find the rectangle with the longest diagonal in a 2D array and return its area, prioritizing maximum area on ties.

简单
3002

移除后集合的最多元素数

Maximize a set size by strategically removing half of elements from two arrays using hash lookups and array scanning.

中等
3005

最大频率元素计数

Count Elements With Maximum Frequency is solved by counting each value, tracking the highest count, and summing matching…

简单
3010

将数组分成最小总代价的子数组 I

Divide an array into three contiguous subarrays with minimum cost by leveraging array and sorting principles.

简单
3011

判断一个数组是否可以变为有序

Determine if a given array can be sorted using adjacent swaps restricted by equal set bits in binary representation.

中等
3012

通过操作使数组长度最小

Minimize the length of an integer array through a series of operations, using a greedy approach with modular arithmetic.

中等
3013

将数组分成最小总代价的子数组 II

This problem asks to divide an array into subarrays with a minimal cost and certain constraints on subarray positions.

困难
3020

子集中元素的最大数量

This problem asks you to find the maximum subset size where each number in the subset follows a specific pattern with ha…

中等
3022

给定操作次数内使剩余元素的或值最小

Minimize the bitwise OR of the remaining elements of an array after applying at most k operations.

困难
3024

三角形类型

Determine the type of triangle from a three-element array using side sums and equality checks efficiently in constant ti…

简单
3025

人员站位的方案数 I

Calculate how many valid pairs of points can be formed on a 2D plane using array and math enumeration techniques efficie…

中等
3026

最大好子数组和

Find the maximum sum of any subarray where the first and last elements differ by exactly k using efficient array scannin…

中等
3027

人员站位的方案数 II

Calculate all valid placements of people on a 2D grid ensuring Alice can fence herself with Bob without enclosing others…

困难
3028

边界上的蚂蚁

Solve the problem of counting how often an ant returns to a boundary based on the steps described in the input array.

简单
3030

找出网格的区域平均强度

Find the Grid of Region Average requires identifying regions in a matrix where pixel differences are below a threshold, …

中等
3033

修改矩阵

Modify the Matrix efficiently by replacing all -1 elements with the maximum in their column using array and matrix opera…

简单
3034

匹配模式数组的子数组数目 I

Count all subarrays in a given integer array that strictly follow a defined numeric pattern using rolling hash checks ef…

中等
3035

回文字符串的最大数量

The problem focuses on maximizing the number of palindromes that can be formed from a given list of words through specif…

中等
3036

匹配模式数组的子数组数目 II

Count subarrays matching a pattern of relative values using array transformation and rolling hash techniques.

困难
3038

相同分数的最大操作数目 I

Determine the maximum number of operations in an integer array where each operation must produce the same score.

简单
3039

进行操作使字符串为空

Learn how to systematically apply operations on a string using array scanning and hash lookups to reduce it efficiently.

中等
3040

相同分数的最大操作数目 II

This problem asks to maximize operations on an integer array where all deletions produce the same score using dynamic pr…

中等
3041

修改数组后最大化数组中的连续元素数目

Solve Maximize Consecutive Elements in an Array After Modification by sorting and using state transition DP on value and…

困难
3042

统计前后缀下标对 I

Count all index pairs where one word is both a prefix and suffix of another, using efficient array and string checks.

简单
3043

最长公共前缀的长度

Determine the length of the longest common prefix between two integer arrays using array scanning and hash lookup effici…

中等
3044

出现频率最高的质数

Find the most frequent prime over 10 from numbers generated by scanning a 2D matrix in all straight directions efficient…

中等
3045

统计前后缀下标对 II

Count the number of index pairs in a string array where one word is both a prefix and suffix of another using array and …

困难
3046

分割数组

Determine if an even-length array can be split into two parts with all distinct elements using hash lookup scanning.

简单
3047

求交集区域内的最大正方形面积

Find the largest square area that can fit inside the intersection of two or more rectangles in a 2D plane.

中等
3048

标记所有下标的最早秒数 I

The problem asks to determine the earliest second to mark all indices in an array using a set of operations.

中等
3049

标记所有下标的最早秒数 II

This problem asks to determine the earliest second at which all indices in an array can be marked using a sequence of op…

困难
3065

超过阈值的最少操作数 I

Count how many numbers are below k, because each such value must be removed in Minimum Operations to Exceed Threshold Va…

简单
3066

超过阈值的最少操作数 II

Calculate the fewest operations to make every array element exceed a threshold using a min-heap simulation strategy effi…

中等
3067

在带权树网络中统计可连接服务器对数目

This problem involves counting pairs of connectable servers in a weighted tree network using binary-tree traversal and D…

中等
3068

最大节点价值之和

Solve Find the Maximum Sum of Node Values by tracking XOR gain parity, not by simulating edge operations across the tree…

困难
3069

将元素分配到两个数组中 I

Distribute elements from a distinct integer array into two subarrays using a sequential simulation strategy for optimal …

简单
3070

元素和小于等于 k 的子矩阵的数目

Count all submatrices including the top-left element with sum less than k using array and matrix prefix sum strategies.

中等
3071

在矩阵上写出字母 Y 所需的最少操作次数

Find the minimum number of operations to write the letter Y on a grid by altering cell values.

中等
3072

将元素分配到两个数组中 II

Distribute elements into two arrays based on conditions, utilizing a Binary Indexed Tree for efficient counting and simu…

困难
3074

重新分装苹果

Distribute packs of apples into boxes using a greedy strategy, minimizing the number of boxes selected efficiently and c…

简单
3075

幸福值最大化的选择方案

Maximize the happiness of selected children by choosing the k happiest ones and applying greedy strategies to minimize l…

中等
3076

数组中的最短非公共子字符串

Find the shortest substring for each string in an array that does not appear in any other string efficiently using hashi…

中等
3077

K 个不相交子数组的最大能量值

Solve Maximum Strength of K Disjoint Subarrays with dynamic programming that tracks segment state, sign changes, and wei…

困难
3079

求出加密整数的和

Compute the sum of encrypted integers by replacing each digit with the largest digit, combining array traversal with dig…

简单
3080

执行操作标记数组中的元素

Efficiently mark elements in an array based on queries using scanning plus hash lookup to track marked indices and compu…

中等
3082

求出所有子序列的能量和

Find the sum of the power of all subsequences of an integer array where their sum equals a given number.

困难
3086

拾起 K 个 1 需要的最少行动次数

Find the minimum number of moves to pick exactly k ones from a binary array, considering a constraint on changes.

困难
3092

最高频率的 ID

Track the most frequent ID after each update in a dynamic collection of IDs with changing frequencies.

中等
3093

最长公共后缀查询

Find the index of the string in wordsContainer with the longest common suffix for each query efficiently using array and…

困难
3095

或值至少 K 的最短子数组 I

Find the shortest non-empty subarray in nums whose bitwise OR reaches at least k using sliding window efficiently.

简单
3096

得到更多分数的最少关卡数目

Determine the minimum number of levels Alice must play in a binary game array to secure more points than Bob using prefi…

中等
3097

或值至少为 K 的最短子数组 II

Find the length of the shortest subarray where the bitwise OR of all its elements is at least a given value.

中等
3098

求出所有子序列的能量和

Compute the sum of powers for all subsequences of length k using state transition dynamic programming efficiently.

困难
3101

交替子数组计数

Count all alternating subarrays in a binary array efficiently using array patterns and simple mathematical reasoning.

中等
3102

最小化曼哈顿距离

Compute the minimum maximum Manhattan distance by removing one point using array math and geometry insights efficiently.

困难
3105

最长的严格递增或递减子数组

Find the longest subarray in a given array that is either strictly increasing or strictly decreasing.

简单
3107

使数组中位数等于 K 的最少操作数

The problem involves minimizing operations to make the median of an array equal to a given value k using a greedy approa…

中等
3108

带权图里旅途的最小代价

Find the minimum cost walk in a weighted graph using array and bit manipulation techniques for efficient path calculatio…

困难
3111

覆盖所有点的最少矩形数目

Find the minimum number of rectangles needed to cover all points, given constraints on width and position.

中等
3112

访问消失节点的最少时间

Determine the minimum time to visit each node in a disappearing-node graph using arrays, graphs, and priority queues eff…

中等
3113

边界元素是最大值的子数组数目

Count the subarrays where the first and last elements are the largest in the subarray, utilizing binary search over vali…

困难
3115

质数的最大距离

Calculate the largest index gap between prime numbers in an array using array traversal and number theory insights effic…

中等
3116

单面值组合的第 K 小金额

Find the kth smallest amount using only one coin denomination at a time, applying binary search efficiently over possibl…

困难
3117

划分数组得到最小的值之和

Solve the problem of dividing an array into subarrays to match specified bitwise AND values using dynamic programming.

困难
3122

使矩阵满足条件的最少操作次数

This problem asks to find the minimum number of operations on a 2D grid using state transition dynamic programming effic…

中等
3127

构造相同颜色的正方形

Determine if a 3x3 grid can form a 2x2 square of the same color by changing at most one cell efficiently.

简单
3128

直角三角形

Count all possible right triangles in a 2D boolean grid using array scanning and hash lookup for efficiency.

中等
3131

找出与数组相加的整数 I

Find the integer added to nums1 to make it equal to nums2 using an array-driven strategy.

简单
3132

找出与数组相加的整数 II

Given two arrays nums1 and nums2, determine the integer added to nums1 to make it equal to nums2 after removing two elem…

中等
3134

找出唯一性数组的中位数

Given a nums array, find the median of its uniqueness array by considering all subarrays and their distinct element coun…

困难
3139

使数组中所有元素相等的最小开销

Compute the minimum cost to make all elements equal using selective operations guided by greedy choices and invariant ch…

困难
3142

判断矩阵是否满足条件

Check if a grid satisfies given conditions by analyzing array and matrix structure with specific checks on values.

简单
3143

正方形中的最多点数

Find the maximum number of points inside a valid square centered at the origin using a scanning and hashing approach.

中等
3145

大数组元素的乘积

Solve queries on a massive array of powers of two using binary search to efficiently compute modular products of subarra…

困难
3147

从魔法师身上吸取的最大能量

Maximize your energy by strategically jumping through magicians using array and prefix sum techniques for optimal path c…

中等
3148

矩阵中的最大得分

Maximize the score in a grid by making moves to the bottom or right, using state transition dynamic programming.

中等
3149

找出分数最低的排列

Determine the lexicographically smallest permutation of nums that minimizes a cyclic score using state transition DP tec…

困难
3151

特殊数组 I

Determine if an array is special by checking alternating parity for every adjacent pair in linear time.

简单
3152

特殊数组 II

Determine whether each subarray meets the special condition of alternating parity for all adjacent elements efficiently …

中等
3153

所有数对中数位差之和

Sum of Digit Differences of All Pairs is a problem that involves counting digit differences in pairs from an array of in…

中等
3158

求出出现两次数字的 XOR 值

Find the XOR of numbers appearing twice by scanning the array and using a hash table for efficient tracking and combinat…

简单
3159

查询数组中元素的出现位置

Determine the position of each requested occurrence of x in nums using a hash table and efficient array scanning.

中等
3160

所有球里面不同颜色的数目

Efficiently track colors on balls using array scanning and hash lookup to return the count of distinct colors after each…

中等
3161

物块放置查询

Determine if blocks can be placed on an infinite number line using queries, leveraging binary search over the valid answ…

困难
3162

优质数对的总数 I

Count all good pairs where an element in nums1 is divisible by a scaled element in nums2 using efficient array scanning.

简单
3164

优质数对的总数 II

Calculate total good pairs by scanning two arrays and using hash lookup to match divisible elements efficiently with k.

中等
3165

不包含相邻元素的子序列的最大和

Compute the maximum sum of a subsequence where no two adjacent elements are selected after each array update efficiently…

困难
3169

无需开会的工作日

Count Days Without Meetings is a problem where you need to count days without scheduled meetings in a given work period.

中等
3171

找到按位或最接近 K 的子数组

Find a subarray with bitwise OR closest to a given value k with minimal absolute difference.

困难
3175

找到连续赢 K 场比赛的第一位玩家

Determine which player first wins k consecutive games using array simulation logic to track ongoing victories efficientl…

中等
3176

求出最长好子序列 I

Find the maximum length of a good subsequence by scanning arrays and using hash lookups for value remapping efficiently.

中等
3177

求出最长好子序列 II

Determine the maximum length of a good subsequence in an integer array using array scanning and hash lookup efficiently.

困难
3179

K 秒后第 N 个元素的值

Solve for the N-th value after K seconds by simulating array updates and using prefix sum techniques.

中等
3180

执行操作可获得的最大总奖励 I

Optimize the total reward by choosing operations on array indices using state transition dynamic programming techniques …

中等
3181

执行操作可获得的最大总奖励 II

Maximize your total reward using dynamic programming with state transitions in this challenging problem involving array …

困难
3184

构成整天的下标对数目 I

Count all pairs in an array where their sum forms a complete day using hash-based counting for efficiency.

简单
3185

构成整天的下标对数目 II

Count the number of valid pairs of hours that form a complete day by checking if their sum is a multiple of 24.

中等
3186

施咒的最大总伤害

Calculate the maximum total damage by selectively casting spells while avoiding adjacent power conflicts using array sca…

中等
3187

数组中的峰值

Determine peaks in a dynamic integer array using efficient Binary Indexed Tree updates and range queries for fast result…

困难
3190

使所有元素都可以被 3 整除的最少操作数

Find the minimum number of operations to make all elements in an array divisible by three.

简单
3191

使二进制数组全部等于 1 的最少操作次数 I

Find the minimum number of operations to make all elements of a binary array equal to one using sliding window and state…

中等
3192

使二进制数组全部等于 1 的最少操作次数 II

Solve the Minimum Operations to Make Binary Array Elements Equal to One II using state transition dynamic programming ef…

中等
3193

统计逆序对的数目

Count the number of valid permutations satisfying inversion constraints using state transition dynamic programming.

困难
3194

最小元素和最大元素的最小平均值

Solve the Minimum Average of Smallest and Largest Elements problem using two-pointer scanning to track averages effectiv…

简单
3195

包含所有 1 的最小矩形面积 I

Find the smallest rectangle to cover all 1's in a 2D binary matrix, focusing on array and matrix handling.

中等
3196

最大化子数组的总成本

Maximize the total cost of alternating subarrays using dynamic programming to efficiently split an array into optimal su…

中等
3197

包含所有 1 的最小矩形面积 II

Find the minimum area to cover all 1's in a 2D binary grid using three non-overlapping rectangles.

困难
3200

三角形的最大高度

Find the maximum height of a triangle that can be formed using red and blue balls under given constraints.

简单
3201

找出有效子序列的最大长度 I

Find the longest valid subsequence in an array of integers using dynamic programming to handle different patterns of seq…

中等
3202

找出有效子序列的最大长度 II

Determine the maximum length of a valid subsequence using state transition dynamic programming with careful modulo const…

中等
3206

交替组 I

Count all alternating groups in a circular array by tracking tiles with distinct neighbors efficiently using sliding win…

简单
3207

与敌人战斗后的最大分数

Solve the "Maximum Points After Enemy Battles" problem by maximizing points through greedy choices with energy validatio…

中等
3208

交替组 II

Solve the problem of counting alternating groups in a circle of tiles using a sliding window approach.

中等
3209

子数组按位与值为 K 的数目

The problem asks to find the number of subarrays with a given AND value in an array, utilizing binary search for optimiz…

困难
3212

统计 X 和 Y 频数相等的子矩阵数量

Count the number of submatrices with equal frequency of 'X' and 'Y' in a 2D character grid.

中等
3213

最小代价构造字符串

This problem asks you to construct a target string using given words at minimal cost using dynamic programming technique…

困难
3217

从链表中移除在数组中存在的节点

Remove nodes from a linked list if their values exist in a given array.

中等
3218

切蛋糕的最小总开销 I

In this problem, you need to minimize the cost of cutting a cake into 1x1 pieces using vertical and horizontal cuts.

中等
3219

切蛋糕的最小总开销 II

Solve Minimum Cost for Cutting Cake II by choosing optimal cuts using a greedy strategy while tracking cost increments p…

困难
3224

使差值相等的最少数组改动次数

Minimize changes to make array differences equal by replacing elements within a given range.

中等
3225

网格图操作后的最大分数

Maximize your score by choosing the optimal sequence of column operations on a grid using dynamic programming transition…

困难
3229

使数组等于目标数组所需的最少操作次数

This problem requires calculating the minimum number of operations to transform one array into another using state trans…

困难
3232

判断是否可以赢得数字游戏

Determine if Alice can guarantee a win in a game by selectively summing single or double-digit numbers from an array.

简单
3233

统计不是特殊数字的数字数量

Count the numbers between two integers that are not special, where special numbers are squares of primes.

中等
3235

判断矩形的两个角落是否可达

Determine if there is a valid path from the bottom-left to top-right of a rectangle while avoiding circles.

困难
3238

求出胜利玩家的数目

Find how many players in a game win by picking more balls of a single color than their index position.

简单
3239

最少翻转次数使二进制矩阵回文 I

Find the minimum flips to make a binary grid palindromic by scanning with two pointers and tracking symmetry efficiently…

中等
3240

最少翻转次数使二进制矩阵回文 II

The problem asks to flip cells in a binary grid to make its rows and columns palindromic using the minimum number of fli…

中等
3242

设计相邻元素求和服务

Design a service that computes sums for adjacent and diagonal elements in a 2D grid.

简单
3243

新增道路查询后的最短距离 I

Solve shortest paths dynamically in a growing graph using BFS, updating distances efficiently after each road addition q…

中等
3244

新增道路查询后的最短距离 II

The problem involves calculating the shortest path from city 0 to city n-1 after each road addition, leveraging greedy c…

困难
3245

交替组 III

Solve Alternating Groups III using array manipulation and a binary indexed tree to track maximal alternating sequences e…

困难
3248

矩阵中的蛇

Solve the Snake in Matrix problem by simulating the snake's movement in a grid based on a series of directional commands…

简单
3250

单调数组对的数目 I

Compute the number of monotonic pairs in an integer array using state transition dynamic programming efficiently.

困难
3251

单调数组对的数目 II

This problem involves finding the count of monotonic pairs in an array using dynamic programming and combinatorics techn…

困难
3254

长度为 K 的子数组的能量值 I

Given an array, find the power of all subarrays of size k using a sliding window approach.

中等
3255

长度为 K 的子数组的能量值 II

Compute the power of all k-size subarrays in an array using sliding window with running state updates efficiently.

中等
3256

放三个车的价值之和最大 I

Maximize the value sum by placing three rooks on a chessboard while ensuring they do not attack each other.

困难
3257

放三个车的价值之和最大 II

Maximize the sum by placing three non-attacking rooks on a chessboard with dynamic programming.

困难
3259

超级饮料的最大强化能量

Maximize energy boost from two drinks with a state transition dynamic programming approach.

中等
3261

统计满足 K 约束的子字符串数量 II

Count Substrings That Satisfy K-Constraint II requires finding valid substrings in a binary string based on a k-constrai…

困难
3264

K 次乘运算后的最终数组 I

Solve the problem of determining the final state of an array after multiple multiplication operations using a priority q…

简单
3265

统计近似相等数对 I

Count Almost Equal Pairs I involves finding pairs of elements that can be made equal by swapping at most one digit.

中等
3266

K 次乘运算后的最终数组 II

Optimize the final state of an array after performing k multiplication operations with priority queues.

困难
3267

统计近似相等数对 II

Count the number of almost equal integer pairs in an array using array scanning and hash lookup efficiently.

困难
3273

对 Bob 造成的最少伤害

Minimize the total damage dealt to Bob using power to eliminate enemies efficiently with greedy approach.

困难
3275

第 K 近障碍物查询

Solve the K-th nearest obstacle query problem using array and heap (priority queue) techniques to find distances efficie…

中等
3276

选择矩阵中单元格的最大得分

Optimize selection of grid cells using state transition dynamic programming to maximize total sum efficiently.

困难
3277

查询子数组最大异或值

Solve the Maximum XOR Score Subarray Queries problem using state transition dynamic programming for optimal subarray com…

困难
3281

范围内整数的最大得分

Maximize Score of Numbers in Ranges asks to find the maximum score by selecting integers within given intervals with a f…

中等
3282

到达数组末尾的最大得分

Calculate the maximum score to reach the end of an array using greedy jumps based on array values and distances.

中等
3283

吃掉所有兵需要的最多移动次数

Calculate the maximum number of moves to eliminate all pawns using BFS, bitmasking, and precise array position math effi…

困难
3285

找到稳定山的下标

Find the indices of stable mountains in an array of mountain heights based on a threshold.

简单
3286

穿越网格图的安全路径

Determine if you can safely traverse a binary grid from top-left to bottom-right using limited health points.

中等
3287

求出数组中最大序列值

Determine the maximum value of a subsequence in an integer array using state transition dynamic programming and bit oper…

困难
3288

最长上升路径的长度

Determine the maximum length of an increasing path in a 2D array using binary search over potential path lengths efficie…

困难
3289

数字小镇中的捣蛋鬼

Find the two numbers that appear twice in a list of integers from 0 to n-1 using array scanning plus hash lookup efficie…

简单
3290

最高乘法得分

The problem requires selecting four indices from an array to maximize a dynamic score with a transition approach.

中等
3291

形成目标字符串需要的最少字符串数 I

Use dynamic programming to split target into the fewest prefixes that match any word prefix, while ruling out dead posit…

中等
3292

形成目标字符串需要的最少字符串数 II

Compute the minimum number of valid strings from an array needed to construct a given target string efficiently using dy…

困难
3295

举报垃圾信息

Determine if a message contains at least two banned words using array scanning and hash lookup.

中等
3296

移山所需的最少秒数

Determine the minimum seconds required to reduce a mountain to zero height using simultaneous workers efficiently.

中等
3300

替换为数位和以后的最小元素

Replace each number with its digit sum and return the smallest resulting value, using array plus math techniques efficie…

简单
3301

高度互不相同的最大塔高和

Assign heights to towers ensuring each height is unique and the total sum is maximized using greedy sorting techniques.

中等
3309

连接二进制表示可形成的最大数值

Determine the largest number achievable by reordering three integers and concatenating their binary forms efficiently.

中等
3311

构造符合图结构的二维矩阵

This problem challenges you to construct a 2D grid from an undirected graph using a given set of edges.

困难
3312

查询排序后的最大公约数

Solve the Sorted GCD Pair Queries problem by efficiently counting and locating GCDs of all array pairs using hash mappin…

困难
3314

构造最小位运算数组 I

Learn how to construct an array minimizing each element while matching given primes using bitwise operations efficiently…

简单
3315

构造最小位运算数组 II

Learn to build the minimum array matching a bitwise OR pattern for each prime in nums, focusing on binary optimization.

中等
3316

从原字符串里进行删除操作的最多次数

Determine the maximum number of characters you can remove from source while keeping pattern as a subsequence using array…

中等
3318

计算子数组的 x-sum I

Compute the x-sum of every subarray of length k efficiently using array scanning combined with hash lookup techniques.

简单
3321

计算子数组的 x-sum II

Calculate the x-sum for every k-length subarray using efficient array scanning and hash-based counting techniques.

困难
3326

使数组非递减的最少除法操作次数

Determine the minimum number of division operations to make an array non-decreasing using a greedy and invariant-based s…

中等
3327

判断 DFS 字符串是否是回文串

Determine if strings formed by DFS traversal of a tree are palindromes using array scanning and hash lookups efficiently…

困难
3331

修改后子树的大小

Calculate the sizes of all subtrees after simultaneous parent changes using array scanning and hash-based counting effic…

中等
3332

旅客可以得到的最多点数

Calculate the maximum points a tourist can earn by choosing optimal city moves over k days using state transition DP.

中等
3334

数组的最大因子得分

Calculate the maximum factor score of an integer array by optionally removing one element using LCM and GCD computations…

中等
3336

最大公约数相等的子序列数量

Count all pairs of non-empty subsequences in an integer array whose elements share the same greatest common divisor effi…

困难
3341

到达最后一个房间的最少时间 I

Find Minimum Time to Reach Last Room I challenges you to determine the minimum time to travel in a dungeon with a grid l…

中等
3342

到达最后一个房间的最少时间 II

Calculate the minimum time to reach the last room in a grid with alternating move times using array and graph patterns.

中等
3346

执行操作后元素的最高频率 I

Maximize the frequency of an element in an array after performing a series of operations to find the best possible resul…

中等
3347

执行操作后元素的最高频率 II

Determine the maximum frequency of any element after performing limited operations using binary search and sliding windo…

困难
3349

检测相邻递增子数组 I

Check if an array contains two adjacent strictly increasing subarrays of length k using an array-driven approach efficie…

简单
3350

检测相邻递增子数组 II

Find the largest k where two adjacent strictly increasing subarrays of length k exist using binary search techniques.

中等
3351

好子序列的元素之和

Calculate the sum of all good subsequences in an array where consecutive numbers differ by exactly one.

困难
3354

使数组元素等于零

Learn how to transform an integer array to zeros using simulation and directional selection efficiently and reliably.

简单
3355

零数组变换 I

Transform the given integer array into a zero array using range operations, focusing on prefix sum optimization and care…

中等
3356

零数组变换 II

Zero Array Transformation II requires determining the minimum query sequence to convert all array elements to zero using…

中等
3357

最小化相邻元素的最大差值

Minimize the maximum adjacent element difference by filling missing values with two chosen numbers.

困难
3361

两个字符串的切换距离

Find the minimum cost of transforming one string into another, considering operations between characters.

中等
3362

零数组变换 III

Zero Array Transformation III requires removing the minimum number of queries to make all elements zero using greedy val…

中等
3363

最多可收集的水果数目

Maximize the number of fruits collected by three children navigating a grid dungeon with dynamic programming.

困难
3364

最小正和子数组

Find the minimum sum of any subarray of size between l and r with a positive total using efficient sliding window logic.

简单
3366

最小数组和

Solve the Minimum Array Sum problem using dynamic programming by tracking states and operations to minimize the sum of a…

中等
3371

识别数组中的最大异常值

Identify the largest outlier in an integer array using scanning and hash lookup for efficient detection and validation.

中等
3375

使数组的值全部为 K 的最少操作次数

Find the minimum operations to convert an array to all values equal k using array scanning and hash lookup efficiently.

简单
3376

破解锁的最少时间 I

Solve the Minimum Time to Break Locks I problem using state transition dynamic programming to minimize the time to break…

中等
3378

统计最小公倍数图中的连通块数目

Determine the number of connected components in an LCM-based graph using array scanning and hash-based connectivity chec…

困难
3379

转换数组

Simulate operations on a circular array to return a transformed result array following specific rules.

简单
3380

用点构造面积最大的矩形 I

Find the maximum area of a rectangle formed by given points on a plane with unique coordinates.

中等
3381

长度可被 K 整除的子数组的最大元素和

Find the maximum sum of a subarray where the length of the subarray is divisible by k.

中等
3382

用点构造面积最大的矩形 II

Find the largest rectangle on a plane using given points while avoiding any interior points and optimizing with math and…

困难
3386

按下时间最长的按钮

Determine which button a child pressed the longest using an array-driven strategy to track time differences efficiently.

简单
3387

两天自由外汇交易后的最大货币数

Compute the maximum currency amount after two days using graph traversal and depth-first search for optimal conversions.

中等
3388

统计数组中的美丽分割

Learn to count all valid beautiful splits in an array using state transition dynamic programming efficiently and accurat…

中等
3392

统计符合条件长度为 3 的子数组数目

Determine how many subarrays of length three satisfy a sum condition on their first and third elements in an array.

简单
3393

统计异或值为给定值的路径数目

Count the number of paths in a grid where the XOR of all values along the path equals a given number.

中等
3394

判断网格图能否被切割成块

Determine if an n x n grid can be divided with two horizontal or vertical cuts using rectangle ranges efficiently.

中等
3395

唯一中间众数子序列 I

Count subsequences of size 5 with a unique middle mode in an integer array using hash table and combinatorics.

困难
3396

使数组元素互不相同所需的最少操作次数

Find the minimum number of operations to make all elements of an array distinct.

简单
3397

执行操作后不同元素的最大数量

Maximize distinct elements in an array by performing at most one operation on each element.

中等
3398

字符相同的最短子字符串 I

Minimize the length of the longest substring with identical characters after at most numOps changes in a binary string.

困难
3402

使每一列严格递增的最少操作次数

Calculate the minimum increments to make each column of a matrix strictly increasing using a greedy invariant approach.

简单
3404

统计特殊子序列的数目

Count the number of special subsequences in an array of positive integers, focusing on efficient array scanning and hash…

中等
3409

最长相邻绝对差递减子序列

Find the length of the longest subsequence with non-increasing absolute adjacent differences.

中等
3410

删除所有值为某个元素后的最大子数组和

Maximize Subarray Sum After Removing All Occurrences of One Element involves finding the optimal subarray sum with one a…

困难
3411

最长乘积等价子数组

This problem involves finding the longest subarray where the product equals the LCM multiplied by the GCD, leveraging a …

简单
3413

收集连续 K 个袋子可以获得的最多硬币数量

Solve the problem of maximizing coins from selecting k consecutive bags, using binary search and sliding window techniqu…

中等
3414

不重叠区间的最大得分

Maximize the score of up to 4 non-overlapping intervals, considering their weight and ensuring no overlap between chosen…

困难
3417

跳过交替单元格的之字形遍历

Traverse a 2D grid in a zigzag pattern while skipping alternate cells, focusing on array and matrix manipulation challen…

简单
3418

机器人可以获得的最大金币数

Find the maximum amount of money a robot can collect while neutralizing robbers on its path in a grid.

中等
3420

统计 K 次操作以内得到非递减子数组的数目

This problem asks you to count non-decreasing subarrays in a given array after applying at most k operations.

困难
3423

循环数组中相邻元素的最大差值

Find the maximum absolute difference between adjacent elements in a circular array using a straightforward array-driven …

简单
3424

将数组变相同的最小代价

Minimize cost to make arrays identical by performing operations with given constraints and a greedy strategy.

中等
3425

最长特殊路径

Compute the longest downward path in a tree with unique node values using DFS, hash lookup, and careful array scanning.

困难
3427

变长子数组求和

Calculate the total sum of all elements in subarrays defined for each index in an array, using the array plus prefix sum…

简单
3428

最多 K 个元素的子序列的最值之和

Find the sum of the maximum and minimum elements of subsequences with at most k elements, using dynamic programming.

中等
3429

粉刷房子 IV

Solve the Paint House IV problem using state transition dynamic programming to minimize the painting costs while adherin…

中等
3430

最多 K 个元素的子数组的最值之和

Compute the sum of maximum and minimum values in all subarrays up to size k using efficient stack-based state management…

困难
3432

统计元素和差值为偶数的分区方案

Count the number of partitions with an even sum difference from an array of integers.

简单
3433

统计用户被提及情况

Calculate how many times each user is mentioned across MESSAGE events, accounting for offline and online statuses effici…

中等
3434

子数组操作后的最大频率

Determine the maximum frequency of a target value k after applying one subarray addition operation efficiently using arr…

中等
3435

最短公共超序列的字母出现频率

Compute all unique shortest common supersequences of given words using graph indegree tracking and topological ordering …

困难
3439

重新安排会议得到最多空余时间 I

Maximize free time by rescheduling up to k non-overlapping meetings within a fixed event using sliding window updates.

中等
3440

重新安排会议得到最多空余时间 II

Maximize free time by rescheduling at most one meeting using a greedy choice with invariant validation approach for arra…

中等
3444

使数组包含目标值倍数的最少增量

This problem involves incrementing elements of an array to make sure each target element has at least one multiple in th…

困难
3446

按对角线进行矩阵排序

Sort Matrix by Diagonals groups cells by diagonal, then sorts bottom-left diagonals descending and top-right diagonals a…

中等
3447

将元素分配给有约束条件的组

Assign elements to groups by size constraints with a sieve-like approach to find suitable element matches efficiently.

中等
3449

最大化游戏分数的最小值

Maximizing the minimum score after at most m moves, leveraging binary search and greedy strategies over an array of scor…

困难
3452

好数字之和

The problem asks for the sum of all good numbers in an array based on specific conditions of neighboring elements.

简单
3453

分割正方形 I

Find the minimum y-coordinate of a horizontal line that balances the areas of squares above and below it.

中等
3454

分割正方形 II

Separate Squares II requires finding the minimum y-coordinate such that squares' areas are split evenly above and below …

困难
3457

吃披萨

Maximize the total weight gained by optimally eating pizzas in groups of four using greedy selection and invariant valid…

中等
3459

最长 V 形对角线段的长度

Compute the maximum length of a V-shaped diagonal segment in a 2D integer matrix using state transition dynamic programm…

困难
3462

提取至多 K 个元素的最大总和

Find the maximum sum by selecting at most k elements from a 2D matrix respecting per-row limits using a greedy strategy.

中等
3464

正方形上的点之间的最大距离

Select k points on a square boundary to maximize minimum Manhattan distance using binary search and greedy placement str…

困难
3467

将数组按照奇偶性转化

Transform an array by sorting even numbers first, followed by odd numbers.

简单
3468

可行数组的数目

Find the number of possible arrays by leveraging bounds and math in this array-based problem.

中等
3469

移除所有数组元素的最小代价

Find the minimum cost to remove all elements from the array with dynamic programming.

中等
3470

全排列 IV

Find the k-th alternating permutation of numbers 1 to n, ensuring no adjacent numbers share parity, using array and math…

困难
3471

找出最大的几近缺失整数

Find the largest almost missing integer in an array where it appears in exactly one subarray of size k.

简单
3473

长度至少为 M 的 K 个子数组之和

Maximize the sum of k non-overlapping subarrays of at least length m using dynamic programming and prefix sums efficient…

中等
3477

水果成篮 II

Determine the number of fruit types that remain unplaced after all allocations in the "Fruits Into Baskets II" problem.

简单
3478

选出和最大的 K 个元素

Choose K Elements With Maximum Sum involves sorting and selecting elements based on a specific rule, applying array plus…

中等
3479

水果成篮 III

Fruits Into Baskets III requires placing fruits into baskets efficiently using binary search over the answer space for c…

中等
3480

删除一个冲突对后最大子数组数目

Maximize the count of subarrays after removing one conflicting pair using array traversal and segment tree logic efficie…

困难
3483

不同三位偶数的数目

Given an array of digits, find how many distinct 3-digit even numbers can be formed without repetition of digits and no …

简单
3484

设计电子表格

Design a spreadsheet that supports setting, retrieving, and resetting values, with the ability to handle formulas refere…

中等
3485

删除元素后 K 个字符串的最长公共前缀

Find the longest common prefix length of k strings after removing an element in the array.

困难
3486

最长特殊路径 II

Find the longest downward path in a tree where node values are mostly distinct, allowing one repeat, using array scannin…

困难
3487

删除后的最大子数组元素和

Maximize the sum of a subarray after performing deletions, ensuring elements remain unique.

简单
3488

距离最小相等元素查询

Find the nearest index with the same value for each query using array scanning combined with hash lookups efficiently.

中等
3493

属性图

Find the number of connected components in an undirected graph formed by properties arrays, using array scanning and has…

中等
3494

酿造药水需要的最少总时间

This problem involves calculating the minimum time required for wizards to brew potions based on their skills and mana u…

中等
3495

使数组元素都变为零的最少操作次数

Minimize operations to reduce array elements to zero, focusing on array manipulation, math, and bit operations for effic…

困难
3500

将数组分割为子数组的最小代价

Optimize array splits with dynamic programming to minimize costs for the Minimum Cost to Divide Array Into Subarrays pro…

困难
3501

操作后最大活跃区段数 II

Maximize the number of active sections in a binary string with at most one trade.

困难
3502

到达每个位置的最小费用

Calculate the minimum swap costs to reach each position in a line using a precise array-driven strategy for efficiency.

简单
3505

使 K 个子数组内元素相等的最少操作数

Compute the minimum operations to ensure at least k non-overlapping subarrays of size x have all equal elements efficien…

困难
3507

移除最小数对使数组有序 I

This problem asks for the minimum number of operations to make an array non-decreasing by removing pairs of elements.

简单
3508

设计路由器

Efficiently design a Router class to manage network packets with memory limits using array scanning and hash lookups.

中等
3509

最大化交错和为 K 的子序列乘积

Find the maximum product of a subsequence in an array with an alternating sum equal to a given target.

困难
3510

移除最小数对使数组有序 II

The problem asks to find the minimum number of operations to make an array non-decreasing by removing pairs of elements.

困难
3512

使数组和能被 K 整除的最少操作次数

This problem asks you to find the minimum operations to make the sum of an array divisible by a given integer k.

简单
3513

不同 XOR 三元组的数目 I

Calculate all unique XOR triplet values in a permutation array using array traversal and bit manipulation techniques eff…

中等
3514

不同 XOR 三元组的数目 II

Count all unique XOR results from triplets in an integer array using array traversal and bit manipulation techniques eff…

中等
3515

带权树中的最短路径

Solve the Shortest Path in a Weighted Tree using binary-tree traversal and efficient state tracking for queries.

困难
3522

执行指令后的得分

Simulate a series of add and jump instructions on arrays to compute the final score efficiently using array scanning and…

中等
3523

非递减数组的最大长度

Determine the maximum size of a non-decreasing array by replacing subarrays with their maximum values efficiently.

中等
3524

求出数组的 X 值 I

Determine the x-value of an array using state transition dynamic programming to count valid prefix-suffix operations eff…

中等
3525

求出数组的 X 值 II

The "Find X Value of Array II" problem requires calculating the number of ways to remove a suffix from an array such tha…

困难
3527

找到最常见的回答

Find the most common survey response after eliminating duplicates within each day, using array scanning and hash lookups…

中等
3529

统计水平子串和垂直子串重叠格子的数目

Efficiently count grid cells appearing in both horizontal and vertical occurrences of a given string pattern using array…

中等
3530

有向无环图中合法拓扑排序的最大利润

Solve the Maximum Profit from Valid Topological Order in DAG problem using graph indegree and topological sorting with d…

困难
3531

统计被覆盖的建筑

Determine how many buildings in an n x n city are completely surrounded using array scanning and hash lookup efficiently…

中等
3532

针对图的路径存在性查询 I

Determine if paths exist between nodes using array scanning and hash lookups for efficient component checks in graphs.

中等
3533

判断连接可整除性

Find the lexicographically smallest permutation of numbers whose concatenation is divisible by k using state transition …

困难
3534

针对图的路径存在性查询 II

Solve path existence queries in a graph using binary search on the answer space, focusing on sorted nodes and maximum di…

困难
3537

填充特殊网格

Fill a Special Grid uses recursive divide-and-conquer to populate a 2^n x 2^n matrix with sequential integers uniquely i…

中等
3538

合并得到最小旅行时间

Minimize the total travel time by merging road signs, using dynamic programming to manage state transitions efficiently.

困难
3539

魔法序列的数组乘积之和

Use state transition dynamic programming to count magical index sequences and accumulate weighted products without enume…

困难
3542

将所有元素变为 0 的最少操作次数

Calculate the fewest operations to turn all numbers in an array to zero using subarray minimum elimination strategy.

中等
3544

子树反转和

This problem involves calculating the maximum possible subtree inversion sum with dynamic programming and binary-tree tr…

困难
3546

等和矩阵分割 I

Determine if an m x n matrix grid can be split into two non-empty sections with equal sums by making a single horizontal…

中等
3548

等和矩阵分割 II

Determine if a matrix can be partitioned into two sections with an equal sum using a single cut.

困难
3550

数位和等于下标的最小下标

Find the smallest index in an array where the sum of the digits equals the index.

简单
3551

数位和排序需要的最小交换次数

Calculate the minimum swaps to sort an array by digit sum, ensuring correct order with tiebreaker values for efficiency.

中等
3552

网格传送门旅游

Find the minimum moves to traverse a 2D grid using standard steps and one-time portal teleports efficiently.

中等
3553

包含要求路径的最小带权子图 II

Solve the Minimum Weighted Subgraph With the Required Paths II problem by leveraging binary-tree traversal and efficient…

困难
3559

给边赋权值的方案数 II

This problem involves assigning edge weights in a tree and calculating the cost of paths based on these weights.

困难
3562

折扣价交易股票的最大利润

Solve the Maximum Profit from Trading Stocks with Discounts problem using binary-tree traversal and dynamic state tracki…

困难
3566

等积子集的划分方案

Determine if you can partition an array into two subsets with equal product using recursion and bit manipulation.

中等
3567

子矩阵的最小绝对差

Find the minimum absolute difference in each k x k submatrix within a given 2D grid using array and sorting techniques.

中等
3568

清理教室的最少移动

Solve the "Minimum Moves to Clean the Classroom" problem using array scanning and hash lookup for an optimized solution.

中等
3569

分割数组后不同质数的最大数目

Compute the maximum number of distinct prime numbers after sequentially updating array elements with efficient preproces…

困难
3572

选择不同 X 值三元组使 Y 值之和最大

Select three distinct x-values from arrays to maximize the sum of their corresponding y-values efficiently using hashing…

中等
3573

买卖股票的最佳时机 V

Maximize profit from stock trades with at most k transactions using state transition dynamic programming for precise dec…

中等
3574

最大子数组 GCD 分数

Maximize Subarray GCD Score focuses on maximizing a subarray's score by using at most k doubling operations on an array …

困难
3575

最大好子树分数

Find the maximum sum of values in a tree subtree without repeating any digit across selected nodes using DFS and bitmask…

困难
3576

数组元素相等转换

Transform Array to All Equal Elements requires careful greedy choices and validating invariants to achieve uniformity ef…

中等
3577

统计计算机解锁顺序排列数

Calculate the total valid unlocking sequences for computers based on their complexity using array and combinatorics logi…

中等
3578

统计极差最大为 K 的分割方式数

Count the number of valid ways to partition an array into contiguous segments where max-min difference is at most k.

中等
3583

统计特殊三元组

Count Special Triplets requires scanning an array while tracking counts of previous and next values efficiently with has…

中等
3584

子序列首尾元素的最大乘积

Maximize the product of the first and last elements of any subsequence of size m in an integer array.

中等
3585

树中找到带权中位节点

Given a weighted tree and queries, find the weighted median node for each path between two nodes using binary-tree trave…

困难
3587

最小相邻交换至奇偶交替

Compute the minimum adjacent swaps to make array elements alternate between even and odd using greedy and invariant chec…

中等
3588

找到最大三角形面积

Find the maximum area of a triangle from 2D coordinates with at least one side parallel to the x-axis or y-axis.

中等
3589

计数质数间隔平衡子数组

Count the number of prime-gap balanced subarrays in an integer array using sliding window techniques and running state u…

中等
3590

第 K 小的路径异或和

This problem involves finding the kth smallest distinct XOR sum for nodes in a subtree of a tree structure using binary-…

困难
3591

检查元素频次是否为质数

Check if any element in the array has a prime frequency count, leveraging array scanning and hash table lookup.

简单
3592

硬币面值还原

Recover coin denominations from a numWays array using state transition dynamic programming to reconstruct valid sets eff…

中等
3593

使叶子路径成本相等的最小增量

Find the minimum number of increments needed to equalize leaf path scores in a tree with different node costs.

中等
3594

所有人渡河所需的最短时间

Find the minimum time to transport individuals across a river with dynamic environmental conditions and boat capacity.

困难
3598

相邻字符串之间的最长公共前缀

Given an array of strings, find the longest common prefix length between adjacent strings after removals at each index.

中等
3599

划分数组得到最小 XOR

Partition an integer array into k subarrays to minimize the maximum XOR using state transition dynamic programming effic…

中等
3603

交替方向的最小路径代价 II

This problem focuses on finding the minimum cost path with alternating directions in a grid using dynamic programming.

中等
3605

数组的最小稳定性因子

The problem requires finding the minimum stability factor of an array by utilizing binary search and math-based optimiza…

困难
3606

优惠券校验器

The Coupon Code Validator problem requires filtering and sorting coupons based on specific criteria for validity.

简单
3607

电网维护

Determine which power stations remain connected after maintenance using array scanning and hash lookups to track compone…

中等
3618

根据质数下标分割数组

Split Array by Prime Indices challenges you to separate elements at prime positions and minimize the absolute sum differ…

中等
3619

总价值可以被 K 整除的岛屿数目

Count the number of islands in a grid where the sum of each island's values is divisible by a given integer k.

中等
3620

恢复网络路径

Find the maximum recovery cost of valid paths in a directed acyclic graph where some nodes are offline.

困难
3623

统计梯形的数目 I

Given a list of distinct points, count the number of unique horizontal trapezoids that can be formed by selecting four p…

中等
3624

位计数深度为 K 的整数数目 II

This problem challenges you to efficiently calculate the number of integers with popcount-depth equal to K using array a…

困难
3625

统计梯形的数目 II

Count Number of Trapezoids II requires scanning point pairs and hashing slopes to efficiently find parallel sides in arr…

困难
3630

划分数组得到最大异或运算和与运算之和

Partition the array into three subsequences to maximize XOR and AND operations with a greedy approach.

困难

关联高频模式

LeetCode 数组题型题解:1672题训练路线