Easy 难度题单

706 道题目

这一层级用于训练对应强度下的解题稳定性与表达完整度,建议每轮固定复盘复杂度、边界和可替代方案。

训练重点

优先稳定基础题感和解释节奏。

建议节奏

每轮 3-5 题,先口述思路再写代码,最后复盘错误路径。

搭配建议

结合模式页和题型页同步练,能更快形成可迁移能力。

1

两数之和

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

简单
9

回文数

Determine if a given integer reads the same forward and backward using a math-driven solution strategy without convertin…

简单
13

罗马数字转整数

Convert a Roman numeral string into an integer using a hash table and mathematical principles to determine value order.

简单
14

最长公共前缀

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

简单
20

有效的括号

Determine if a string of parentheses, brackets, and braces is correctly nested using a stack for proper order validation…

简单
21

合并两个有序链表

Merge two sorted linked lists by splicing nodes into one sorted list using linked-list pointer manipulation and recursio…

简单
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…

简单
28

找出字符串中第一个匹配项的下标

Locate the first occurrence of a substring within a string using a two-pointer scanning strategy and invariant tracking …

简单
35

搜索插入位置

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

简单
58

最后一个单词的长度

Determine the length of the last word in a string using a focused string-driven approach to handle spaces and trailing c…

简单
66

加一

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

简单
67

二进制求和

Add Binary involves summing two binary strings and returning the result as a binary string using math and string manipul…

简单
69

x 的平方根

Solve the Sqrt(x) problem using binary search to find the integer square root of a number without built-in operators.

简单
70

爬楼梯

Climbing Stairs is a classic dynamic programming problem where you calculate distinct ways to reach the top using step t…

简单
83

删除排序链表中的重复元素

Efficiently remove duplicates from a sorted linked list using precise pointer manipulation while maintaining node order …

简单
88

合并两个有序数组

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

简单
94

二叉树的中序遍历

Binary Tree Inorder Traversal asks you to visit left subtree, node, then right subtree without losing position while mov…

简单
100

相同的树

Check whether two binary trees are identical by comparing structure and node values using DFS or BFS traversal strategie…

简单
101

对称二叉树

Determine if a binary tree is symmetric by comparing left and right subtrees using DFS or BFS traversal techniques effic…

简单
104

二叉树的最大深度

Find the maximum depth of a binary tree using traversal techniques to track the longest path from root to leaf.

简单
108

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

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

简单
110

平衡二叉树

Determine if a binary tree is height-balanced using tree traversal and state tracking techniques.

简单
111

二叉树的最小深度

Find the minimum depth of a binary tree, which is the shortest path from the root node to the nearest leaf node.

简单
112

路径总和

Determine if a binary tree has a root-to-leaf path where the sum of node values equals a given target sum, using DFS or …

简单
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…

简单
121

买卖股票的最佳时机

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

简单
125

验证回文串

Check if a given string is a valid palindrome by using two-pointer scanning and invariant tracking techniques.

简单
136

只出现一次的数字

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

简单
141

环形链表

Determine if a given linked list contains a cycle using pointer manipulation or hashing, focusing on detecting repeated …

简单
144

二叉树的前序遍历

Perform a binary tree preorder traversal by visiting root nodes first, then left and right subtrees, tracking state iter…

简单
145

二叉树的后序遍历

Solve Binary Tree Postorder Traversal using state tracking and binary-tree traversal techniques, focusing on Stack, Tree…

简单
160

相交链表

Given two linked lists, find the node where they intersect or return null if they do not.

简单
168

Excel 表列名称

Convert a positive integer to its corresponding Excel column title using base-26 math and string manipulation efficientl…

简单
169

多数元素

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

简单
171

Excel 表列序号

This problem requires converting an Excel column title into its corresponding column number by applying a math and strin…

简单
190

颠倒二进制位

Reverse a 32-bit unsigned integer by manipulating bits efficiently using a divide and conquer approach with careful bit …

简单
191

位1的个数

Number of 1 Bits is a classic bit manipulation problem where clearing the lowest set bit gives the cleanest count.

简单
202

快乐数

Determine if a number is happy by repeatedly summing squares of digits using two-pointer scanning to detect cycles effic…

简单
203

移除链表元素

Remove all nodes from a linked list that have a specific value, adjusting pointers to preserve the rest of the list.

简单
205

同构字符串

Determine if two strings are isomorphic by checking if one string can be transformed into the other using character repl…

简单
206

反转链表

Reverse a singly linked list in place, converting the head to tail, with an iterative or recursive approach.

简单
217

存在重复元素

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

简单
219

存在重复元素 II

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

简单
222

完全二叉树的节点个数

Count Complete Tree Nodes efficiently by leveraging binary-tree traversal, exploiting completeness, and applying bit man…

简单
225

用队列实现栈

This problem tests your ability to simulate a LIFO stack using two queues while preserving all standard stack operations…

简单
226

翻转二叉树

Invert Binary Tree swaps every node's left and right children using tree traversal, with recursive DFS or iterative BFS …

简单
228

汇总区间

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

简单
231

2 的幂

Determine if a given integer is a power of two using efficient math and bit manipulation techniques with optional recurs…

简单
232

用栈实现队列

Implement a queue using two stacks, focusing on stack-based state management to achieve FIFO behavior in a queue.

简单
234

回文链表

Solve Palindrome Linked List by finding the midpoint, reversing the second half, and comparing mirrored nodes in linear …

简单
242

有效的字母异位词

Check if two strings are anagrams using hashing or sorting techniques.

简单
257

二叉树的所有路径

Find all root-to-leaf paths in a binary tree using DFS and backtracking, constructing strings for each complete path eff…

简单
258

各位相加

Add Digits involves repeatedly summing digits of a number until a single digit is obtained.

简单
263

丑数

The Ugly Number problem asks you to determine if a number is divisible only by 2, 3, or 5.

简单
268

丢失的数字

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

简单
278

第一个错误的版本

Find the first bad version of a product using binary search, minimizing the number of API calls.

简单
283

移动零

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

简单
290

单词规律

Solve Word Pattern by checking a one-to-one mapping between pattern letters and words using hash tables after splitting …

简单
292

Nim 游戏

In Nim Game, determine if you can win given a certain number of stones, assuming optimal play from both players.

简单
303

区域和检索 - 数组不可变

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

简单
326

3 的幂

Determine if a given integer is a power of three using math and recursion techniques.

简单
338

比特位计数

Compute the number of 1 bits for every integer from 0 to n using state transition dynamic programming for efficiency.

简单
342

4的幂

Determine if a given integer is a power of four using math insights and bit manipulation tricks efficiently in code.

简单
344

反转字符串

Reverse a character array in-place using a two-pointer scanning technique, ensuring minimal memory and correct index swa…

简单
345

反转字符串中的元音字母

Reverse Vowels of a String uses a two-pointer approach to reverse the vowels in a string while leaving the consonants in…

简单
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.

简单
367

有效的完全平方数

Determine if a given positive integer is a perfect square using a binary search approach over potential square roots eff…

简单
374

猜数字大小

Find the picked number efficiently using binary search while adjusting guesses based on higher or lower feedback in this…

简单
383

赎金信

Determine if a ransom note can be constructed from a magazine's letters using hash tables and string counting techniques…

简单
387

字符串中的第一个唯一字符

Find the index of the first non-repeating character in a string using efficient queue-driven state processing.

简单
389

找不同

Find the Difference involves identifying the additional letter in one string compared to another, emphasizing hash table…

简单
392

判断子序列

Determine if one string is a subsequence of another using state transition dynamic programming for accurate character ma…

简单
401

二进制手表

Binary Watch involves generating possible times on a binary watch given a number of turned-on LEDs.

简单
404

左叶子之和

Compute the total of all left leaves in a binary tree using precise traversal and state tracking techniques for correctn…

简单
405

数字转换为十六进制数

Convert a 32-bit integer to its hexadecimal string using math operations and careful string manipulation techniques.

简单
409

最长回文串

Determine the length of the longest palindrome constructible from a given string using greedy counting and frequency tra…

简单
412

Fizz Buzz

Generate a list from 1 to n replacing multiples of 3 with Fizz, 5 with Buzz, and both with FizzBuzz efficiently.

简单
414

第三大的数

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

简单
415

字符串相加

Given two non-negative integers as strings, sum them and return the result as a string without converting to integers di…

简单
434

字符串中的单词数

Count the segments of non-space characters in a string by applying a string-driven approach to solve the problem.

简单
441

排列硬币

Determine the maximum number of complete staircase rows possible with n coins using a binary search approach.

简单
448

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

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

简单
455

分发饼干

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

简单
459

重复的子字符串

Check if a string can be constructed by repeating a substring using string matching techniques.

简单
461

汉明距离

Calculate the Hamming distance between two integers by counting differing bit positions.

简单
463

岛屿的周长

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

简单
476

数字的补数

The Number Complement problem requires flipping bits in a number’s binary representation to return its complement.

简单
482

密钥格式化

Reformat a license key string by splitting into groups of size k, converting to uppercase, and handling dashes appropria…

简单
485

最大连续 1 的个数

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

简单
492

构造矩形

Given an area, design a rectangle with integer length and width optimizing L >= W and minimal difference, using math.

简单
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.

简单
500

键盘行

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

简单
501

二叉搜索树中的众数

Find Mode in Binary Search Tree asks to identify the most frequent element(s) in a BST using binary-tree traversal.

简单
504

七进制数

Convert any given integer to its base 7 string representation using efficient math and string manipulation techniques.

简单
506

相对名次

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

简单
507

完美数

Check if a given number is a perfect number by verifying if it's equal to the sum of its divisors, excluding itself.

简单
509

斐波那契数

Calculate the nth Fibonacci number using state transition dynamic programming and recursive techniques efficiently in in…

简单
520

检测大写字母

Detect Capital asks you to determine if a word follows a correct capital usage pattern based on specific rules.

简单
521

最长特殊序列 Ⅰ

Determine the length of the longest uncommon subsequence between two strings using a direct string comparison strategy.

简单
530

二叉搜索树的最小绝对差

Find the minimum absolute difference between values of any two nodes in a BST using tree traversal and careful state tra…

简单
541

反转字符串 II

Reverse String II requires reversing segments of a string using two-pointer scanning while tracking invariants carefully…

简单
543

二叉树的直径

The Diameter of Binary Tree problem involves finding the longest path between any two nodes using tree traversal techniq…

简单
551

学生出勤记录 I

Determine if a student's attendance record qualifies for an award based on specific criteria for absences and lateness.

简单
557

反转字符串中的单词 III

Reverse Words in a String III involves reversing each word in a sentence using the two-pointer technique.

简单
559

N 叉树的最大深度

Find the maximum depth of an N-ary tree, leveraging tree traversal techniques and state tracking.

简单
561

数组拆分

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

简单
563

二叉树的坡度

Calculate the sum of the binary tree's node tilts using tree traversal and state tracking.

简单
566

重塑矩阵

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

简单
572

另一棵树的子树

Determine if one binary tree is an exact subtree of another by comparing structure and node values recursively.

简单
575

分糖果

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

简单
589

N 叉树的前序遍历

Solve the N-ary Tree Preorder Traversal problem using depth-first search and stack-based traversal methods.

简单
590

N 叉树的后序遍历

Postorder traversal of an N-ary tree can be efficiently solved using DFS and stack-based methods, tracking state across …

简单
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.

简单
617

合并二叉树

Merge Two Binary Trees requires combining nodes by summing overlapping values while preserving non-null nodes from eithe…

简单
628

三个数的最大乘积

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

简单
637

二叉树的层平均值

Calculate the average value of nodes on each level of a binary tree using traversal and state tracking.

简单
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…

简单
653

两数之和 IV - 输入二叉搜索树

Determine if a binary search tree contains two nodes whose values sum to a target using efficient traversal and state tr…

简单
657

机器人能否返回原点

Judge whether a robot returns to the origin after a sequence of moves using string manipulation and simulation.

简单
661

图片平滑器

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

简单
671

二叉树中第二小的节点

Find the second minimum node in a binary tree by traversing the tree and tracking state.

简单
674

最长连续递增序列

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

简单
680

验证回文串 II

Check if a string can become a palindrome by deleting at most one character using two-pointer scanning and invariant tra…

简单
682

棒球比赛

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

简单
693

交替位二进制数

Check whether a given integer has alternating bits using a bit manipulation approach.

简单
696

计数二进制子串

Count Binary Substrings solves for the number of valid substrings with equal 0's and 1's, grouped consecutively in a bin…

简单
697

数组的度

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

简单
700

二叉搜索树中的搜索

Locate a target value in a binary search tree and return the subtree rooted at that node using efficient tree traversal …

简单
703

数据流中的第 K 大元素

Find the kth largest element in a dynamic stream using binary-tree traversal and efficient state tracking with a min-hea…

简单
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…

简单
709

转换成小写字母

The "To Lower Case" problem asks you to convert all uppercase letters in a string to lowercase.

简单
717

1 比特与 2 比特字符

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

简单
724

寻找数组的中心下标

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

简单
728

自除数

Identify self-dividing numbers in a given range by verifying divisibility against their digits.

简单
733

图像渲染

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

简单
744

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

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

简单
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…

简单
762

二进制表示中质数个计算置位

Count numbers with prime set bits in a binary representation within a given range.

简单
766

托普利茨矩阵

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

简单
771

宝石与石头

Given two strings, determine how many of the stones you have are also jewels, considering case sensitivity.

简单
783

二叉搜索树节点最小距离

Find the minimum difference between values of two different nodes in a Binary Search Tree using tree traversal and state…

简单
796

旋转字符串

Determine if one string can be rotated into another by repeatedly shifting characters, leveraging string matching techni…

简单
804

唯一摩尔斯密码词

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

简单
806

写字符串需要的行数

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

简单
812

最大三角形面积

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

简单
819

最常见的单词

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

简单
821

字符的最短距离

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

简单
824

山羊拉丁文

Convert a sentence to Goat Latin by transforming each word based on vowel rules and incremental suffixes efficiently.

简单
830

较大分组的位置

Identify and return intervals of consecutive, large character groups in a string of lowercase letters.

简单
832

翻转图像

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

简单
836

矩形重叠

Determine if two axis-aligned rectangles overlap based on their coordinates.

简单
844

比较含退格的字符串

Compare two strings after processing backspaces using efficient two-pointer scanning and careful invariant tracking to e…

简单
859

亲密字符串

Determine if two strings can become equal by swapping exactly two letters using a hash table for character tracking.

简单
860

柠檬水找零

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

简单
867

转置矩阵

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

简单
868

二进制间距

Find the maximum distance between consecutive 1's in a number's binary form using precise bit manipulation techniques.

简单
872

叶子相似的树

Determine if two binary trees have identical leaf sequences using efficient traversal and state tracking techniques.

简单
876

链表的中间结点

Find the middle node of a singly linked list using a two-pointer technique.

简单
883

三维形体投影面积

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

简单
884

两句话中的不常见单词

Find uncommon words from two sentences by counting word frequencies using hash tables.

简单
888

公平的糖果交换

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

简单
892

三维形体的表面积

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

简单
896

单调数列

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

简单
897

递增顺序搜索树

Rearrange a binary search tree so all nodes follow increasing order with only right children using in-order traversal.

简单
905

按奇偶排序数组

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

简单
908

最小差值 I

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

简单
914

卡牌分组

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

简单
917

仅仅反转字母

Reverse the characters of a string while skipping non-letter characters using a two-pointer technique.

简单
922

按奇偶排序数组 II

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

简单
925

长按键入

Check if a typed string could result from long pressing characters while typing a given name using a two-pointer scan.

简单
929

独特的电子邮件地址

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

简单
933

最近的请求次数

The "Number of Recent Calls" problem involves designing a class to efficiently track recent requests within a time windo…

简单
938

二叉搜索树的范围和

Given a BST and a range, calculate the sum of all node values within that range.

简单
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 …

简单
944

删列造序

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

简单
953

验证外星语词典

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

简单
961

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

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

简单
965

单值二叉树

Determine if a binary tree is uni-valued using traversal and state tracking techniques.

简单
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.

简单
989

数组形式的整数加法

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

简单
993

二叉树的堂兄弟节点

Determine if two nodes in a binary tree are cousins by leveraging binary-tree traversal and state tracking.

简单
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…

简单
1002

查找共用字符

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

简单
1005

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

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

简单
1009

十进制整数的反码

In this problem, you need to return the complement of a given integer by flipping its binary digits.

简单
1013

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

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

简单
1018

可被 5 整除的二进制前缀

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

简单
1021

删除最外层的括号

Remove Outermost Parentheses simplifies a valid parentheses string by removing the outermost layers of parentheses in ea…

简单
1022

从根到叶的二进制数之和

Calculate the sum of binary numbers from root to leaf paths in a binary tree.

简单
1025

除数博弈

Divisor Game is a game theory problem where players take turns subtracting divisors of a number n until one player loses…

简单
1030

距离顺序排列矩阵单元格

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

简单
1037

有效的回旋镖

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

简单
1046

最后一块石头的重量

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

简单
1047

删除字符串中的所有相邻重复项

Solve Remove All Adjacent Duplicates In String by simulating deletions with a stack that collapses matching neighbors im…

简单
1051

高度检查器

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

简单
1071

字符串的最大公因子

Find the greatest common divisor string between two strings based on the math and string patterns.

简单
1078

Bigram 分词

Extract the third word in every adjacent triple of words matching a given bigram pattern from a text.

简单
1089

复写零

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

简单
1103

分糖果 II

Distribute candies to people in a way that follows a mathematical pattern, ensuring the distribution is correct.

简单
1108

IP 地址无效化

Transform an IPv4 address by replacing each period with '[.]', focusing on a string-driven, direct manipulation approach…

简单
1122

数组的相对排序

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

简单
1128

等价多米诺骨牌对的数量

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

简单
1137

第 N 个泰波那契数

Compute the N-th Tribonacci number using state transition dynamic programming with careful memoization and iterative upd…

简单
1154

一年中的第几天

Calculate the day number of the year based on a given Gregorian calendar date in the format YYYY-MM-DD.

简单
1160

拼写单词

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

简单
1175

质数排列

Calculate the number of valid permutations of 1 to n where prime numbers occupy prime indices using math-driven logic.

简单
1184

公交站间的距离

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

简单
1185

一周中的第几天

Given a date, calculate the corresponding weekday using a math-based strategy, focusing on modular arithmetic.

简单
1189

“气球” 的最大数量

Find the maximum number of times the word 'balloon' can be formed from characters of the given string.

简单
1200

最小绝对差

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

简单
1207

独一无二的出现次数

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

简单
1217

玩筹码

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

简单
1221

分割平衡字符串

Split a string into the maximum number of balanced substrings where each substring has an equal number of 'L' and 'R'.

简单
1232

缀点成线

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

简单
1252

奇数值单元格的数目

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

简单
1260

二维网格迁移

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

简单
1266

访问所有点的最小时间

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

简单
1275

找出井字棋的获胜者

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

简单
1281

整数的各位积和之差

Calculate the difference between the product and sum of an integer's digits using a simple math-driven approach for effi…

简单
1287

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

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

简单
1290

二进制链表转整数

Convert a binary number represented in a linked list to its decimal value using efficient pointer manipulation.

简单
1295

统计位数为偶数的数字

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

简单
1299

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

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

简单
1304

和为零的 N 个不同整数

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

简单
1309

解码字母到整数映射

Decrypt a string using alphabet-to-integer mapping, considering the presence of '#' as a special delimiter.

简单
1313

解压缩编码列表

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

简单
1317

将整数转换为两个无零整数的和

Find two positive integers whose sum equals n and neither contains the digit zero, using a direct math-driven approach.

简单
1323

6 和 9 组成的最大数字

Maximize a number by flipping at most one digit from 6 to 9 or vice versa.

简单
1331

数组序号转换

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

简单
1332

删除回文子序列

This problem challenges you to remove palindromic subsequences from a string with a minimum number of steps using two-po…

简单
1337

矩阵中战斗力最弱的 K 行

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

简单
1342

将数字变成 0 的操作次数

Reduce a number to zero using bit manipulation and math. Simulate the process step-by-step based on whether the number i…

简单
1346

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

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

简单
1351

统计有序矩阵中的负数

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

简单
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.

简单
1360

日期之间隔几天

Calculate the exact number of days between two dates using string parsing and arithmetic logic with consistent accuracy.

简单
1365

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

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

简单
1370

上升下降字符串

Reorder the string based on a specific algorithm using hash tables and string manipulation.

简单
1374

生成每种字符都是奇数个的字符串

Generate a string of n characters where each character appears an odd number of times, using a string-driven approach.

简单
1379

找出克隆二叉树中的相同节点

Find the corresponding node in a cloned binary tree using binary-tree traversal and state tracking.

简单
1380

矩阵中的幸运数

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

简单
1385

两个数组间的距离值

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

简单
1389

按既定顺序创建目标数组

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

简单
1394

找出数组中的幸运数

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

简单
1399

统计最大组的数目

Count the number of groups with the largest size by summing digits of numbers from 1 to n using a hash table approach.

简单
1403

非递增顺序的最小子序列

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

简单
1408

数组中的字符串匹配

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

简单
1413

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

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

简单
1417

重新格式化字符串

Reformat The String involves rearranging alphanumeric characters in a string so that no adjacent characters have the sam…

简单
1422

分割字符串的最大得分

Find the optimal split point in a binary string to maximize zeros on the left and ones on the right efficiently.

简单
1431

拥有最多糖果的孩子

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

简单
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.

简单
1446

连续字符

Find the power of a string by determining the length of its longest substring with a unique character.

简单
1450

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

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

简单
1455

检查单词是否为句中其他单词的前缀

Determine the first word in a sentence where a given searchWord is a prefix using two-pointer scanning with string match…

简单
1460

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

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

简单
1464

数组中两元素的最大乘积

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

简单
1470

重新排列数组

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

简单
1475

商品折扣后的最终价格

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

简单
1480

一维数组的动态和

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

简单
1486

数组异或操作

Compute the bitwise XOR of a dynamically generated array using a combination of math and bit manipulation techniques eff…

简单
1491

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

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

简单
1496

判断路径是否相交

Check if a path crosses itself on a 2D plane using a hash table to track visited points during traversal.

简单
1502

判断能否形成等差数列

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

简单
1507

转变日期格式

Reformat Date requires transforming a date string from human-readable form to YYYY-MM-DD using a string-driven strategy …

简单
1512

好数对的数目

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

简单
1518

换水问题

Maximize the number of water bottles you can drink by simulating the exchange process between full and empty bottles.

简单
1523

在区间范围内统计奇数数目

Count Odd Numbers in an Interval Range efficiently using a math-driven formula that avoids unnecessary iteration over la…

简单
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 …

简单
1539

第 k 个缺失的正整数

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

简单
1544

整理字符串

This problem requires removing adjacent characters that cancel each other out, leveraging stack-based state management.

简单
1550

存在连续三个奇数的数组

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

简单
1556

千位分隔数

Convert a given integer into a string with dots as thousand separators using a precise string-driven strategy.

简单
1560

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

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

简单
1566

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

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

简单
1572

矩阵对角线元素的和

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

简单
1576

替换所有的问号

Solve LeetCode 1576 by scanning left to right and replacing each ? with a letter different from its neighbors.

简单
1582

二进制矩阵中的特殊位置

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

简单
1588

所有奇数长度子数组的和

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

简单
1592

重新排列单词间的空格

Rearrange spaces between words by distributing them evenly, placing any leftover spaces at the end to match original tex…

简单
1598

文件夹操作日志搜集器

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

简单
1603

设计停车系统

Implement a class to manage a parking lot with fixed slots for big, medium, and small cars, tracking occupancy efficient…

简单
1608

特殊数组的特征值

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

简单
1614

括号的最大嵌套深度

Find the maximum nesting depth of parentheses in a valid string using stack-based state management.

简单
1619

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

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

简单
1624

两个相同字符之间的最长子字符串

Find the longest substring between two equal characters using a hash table for optimized performance.

简单
1629

按键持续时间最长的键

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

简单
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.

简单
1640

能否连接形成数组

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

简单
1646

获取生成数组中的最大值

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

简单
1652

拆炸弹

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

简单
1656

设计有序流

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

简单
1662

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

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

简单
1668

最大重复子字符串

Find the maximum number of times a given word repeats consecutively in a string using state transition dynamic programmi…

简单
1672

最富有客户的资产总量

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

简单
1678

设计 Goal 解析器

Interpret the Goal Parser's output by analyzing a command string containing 'G', '()', and '(al)' patterns.

简单
1684

统计一致字符串的数目

Count the number of strings fully composed of allowed characters using array scanning and hash lookup for efficiency.

简单
1688

比赛中的配对次数

Calculate the total matches in a tournament by simulating rounds and applying simple math rules for advancing teams.

简单
1694

重新格式化电话号码

Reformat a phone number by removing spaces and dashes, grouping digits into blocks of 3 or 2, and joining them with dash…

简单
1700

无法吃午餐的学生数量

Simulate a queue of students with sandwich preferences and determine how many can't eat based on available sandwiches.

简单
1704

判断字符串的两半是否相似

Check if two halves of a string contain the same number of vowels using a character counting approach efficiently.

简单
1710

卡车上的最大单元数

Maximize total units loaded on a truck by choosing boxes greedily based on highest units per box within truck capacity l…

简单
1716

计算力扣银行的钱

Calculate the total amount of money in the Leetcode bank at the end of the nth day, based on a weekly increasing deposit…

简单
1720

解码异或后的数组

Recover the original integer array from its XOR-encoded version using direct bitwise manipulation and sequential reconst…

简单
1725

可以形成最大正方形的矩形数目

Determine how many rectangles can be trimmed to form the largest possible square using an array-driven solution strategy…

简单
1732

找到最高海拔

Find the highest altitude after a series of altitude changes during a road trip using prefix sum technique.

简单
1736

替换隐藏数字得到的最晚时间

Determine the latest valid time by replacing hidden digits using a greedy choice and invariant validation strategy effic…

简单
1742

盒子中小球的最大数量

The problem asks you to find the box with the maximum number of balls based on the sum of digits of ball numbers.

简单
1748

唯一元素的和

Given an array, find the sum of all its unique elements by identifying those that appear only once.

简单
1752

检查数组是否经排序和轮转得到

Determine if a given integer array is sorted in non-decreasing order and then rotated, handling duplicates correctly.

简单
1758

生成交替二进制字符串的最少操作数

Find the minimum number of changes required to convert a string into an alternating binary string.

简单
1763

最长的美好子字符串

Find the longest nice substring in a given string using the sliding window technique with running state updates.

简单
1768

交替合并字符串

Merge two strings alternately, starting with the first string, and append extra characters when one string is longer.

简单
1773

统计匹配检索规则的物品数量

Count Items Matching a Rule is an easy problem that tests array and string manipulation with conditions based on specifi…

简单
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.

简单
1784

检查二进制字符串字段

Check if a binary string contains at most one contiguous segment of ones.

简单
1790

仅执行一次字符串交换能否使两个字符串相等

Check if one string swap can make two equal strings using hash table and string counting methods.

简单
1791

找出星型图的中心节点

Find the center node of a star graph, where one node connects to all others.

简单
1796

字符串中第二大的数字

Given a string with alphanumeric characters, find the second largest digit, or return -1 if it doesn’t exist.

简单
1800

最大升序子数组和

Solve Maximum Ascending Subarray Sum by scanning once, extending rising runs, and resetting the running sum at each drop…

简单
1805

字符串中不同整数的数目

Count all unique integers in a string by replacing letters and handling leading zeros correctly with a hash table approa…

简单
1812

判断国际象棋棋盘中一个格子的颜色

Determine whether a given chessboard square is white or black by converting coordinates using a math plus string approac…

简单
1816

截断句子

Truncate a sentence to contain only the first k words by converting it into an array of words.

简单
1822

数组元素积的符号

Determine the sign of a product from an integer array using a single pass without computing the full product.

简单
1827

最少操作使数组递增

Calculate the minimum number of increments required to transform a given integer array into a strictly increasing sequen…

简单
1832

判断句子是否为全字母句

Determine if a given lowercase string contains every English letter using efficient hash table tracking techniques.

简单
1837

K 进制表示下的各位数字总和

Calculate the sum of digits of a number after converting it from base 10 to any given base using a math-driven approach.

简单
1844

将所有数字用字符替换

Transform a string by replacing digits at odd indices using the preceding character with a shift operation for accurate …

简单
1848

到目标元素的最小距离

Solve Minimum Distance to the Target Element by scanning the array and tracking the smallest distance from start.

简单
1854

人口最多的年份

Find the earliest year with the highest population using an array plus counting approach.

简单
1859

将句子排序

Reconstruct a shuffled sentence by sorting words using their embedded indices to restore the original sentence order eff…

简单
1863

找出所有子集的异或总和再求和

Compute the sum of all subset XOR totals using a backtracking search with pruning for arrays of small size.

简单
1869

哪种连续子字符串更长

Determine if the longest segment of 1s in a binary string is strictly longer than the longest segment of 0s.

简单
1876

长度为三且各字符不同的子字符串

Count all substrings of length three in a string where each character is unique using sliding window techniques efficien…

简单
1880

检查某单词是否等于两单词之和

Check if the sum of two word values equals a target word's value by converting letters to their numeric representations.

简单
1886

判断矩阵经轮转后是否一致

Determine if a binary matrix can be transformed into another by rotating it 90 degrees multiple times.

简单
1893

检查是否区域内所有整数都被覆盖

Check if all integers in the range [left, right] are covered by intervals in a given set of ranges.

简单
1897

重新分配字符使所有字符串都相等

Determine if you can redistribute characters among strings so that all strings become identical using a counting approac…

简单
1903

字符串中的最大奇数

Find the largest odd number in a string using a greedy approach with careful digit inspection and invariant checks.

简单
1909

删除一个元素使数组严格递增

Determine if removing a single element from an array can make it strictly increasing, using a careful index check approa…

简单
1913

两个数对之间的最大乘积差

Find the maximum product difference between two pairs in an integer array using sorting for optimal selection.

简单
1920

基于排列构建数组

The problem asks to build an array from a given permutation using an efficient approach.

简单
1925

统计平方和三元组的数目

Count Square Sum Triples asks to find the number of integer triples where a² + b² = c² for values between 1 and n.

简单
1929

数组串联

This problem asks you to create an array of double the size, where each element is repeated twice in sequence.

简单
1935

可以输入的最大单词数

Determine how many words can be typed on a malfunctioning keyboard with some broken keys.

简单
1941

检查是否所有字符出现次数相同

Check if a string has characters with equal occurrences using hash tables and string manipulation techniques.

简单
1945

字符串转化后的各位数字之和

Convert a lowercase string into digits and repeatedly sum them k times using a direct string plus simulation approach.

简单
1952

三除数

Determine if a given integer has exactly three positive divisors.

简单
1957

删除字符使字符串变好

This problem asks to remove the minimum number of characters from a string to ensure no three consecutive characters are…

简单
1961

检查字符串是否为数组前缀

Determine if a string is a prefix of an array by concatenating initial elements, using two-pointer scanning efficiently.

简单
1967

作为子字符串出现在单词中的字符串数目

Count how many strings in an array appear as substrings within a given word by checking each pattern individually.

简单
1971

寻找图中是否存在路径

Determine if a valid path exists between two vertices in a bi-directional graph using traversal techniques.

简单
1974

使用特殊打字机键入单词的最少时间

Compute the minimum typing time by greedily taking the shorter circular move between consecutive letters, then adding on…

简单
1979

找出数组的最大公约数

Find the greatest common divisor of the smallest and largest numbers in an integer array.

简单
1984

学生分数的最小差值

Minimize the difference between the highest and lowest of k student scores using a sliding window approach.

简单
1991

找到数组的中间位置

Find the smallest middle index where the sum of elements on the left equals the sum on the right using prefix sums effic…

简单
1995

统计特殊四元组

Count Special Quadruplets requires scanning arrays and using hash lookups to efficiently find quadruplets matching sum c…

简单
2000

反转单词前缀

Reverse the prefix of a string starting from index 0 to the first occurrence of a given character.

简单
2006

差的绝对值为 K 的数对数目

Find how many pairs (i, j) with i < j satisfy |nums[i] - nums[j]| == k using array scanning and hash lookup.

简单
2011

执行操作后的变量值

Compute the final value of X by simulating each string operation in the array sequentially with careful tracking.

简单
2016

增量元素之间的最大差值

Find the maximum difference between two increasing elements in an array using a linear scan to track the minimum value e…

简单
2022

将一维数组转变成二维数组

Convert a 1D integer array into a structured 2D array with specified rows and columns using all elements sequentially.

简单
2027

转换字符串的最少操作次数

Minimize moves to convert a string of 'X' and 'O' to all 'O' by converting three consecutive characters to 'O'.

简单
2032

至少在两个数组中出现的值

Identify all elements appearing in at least two of three arrays using efficient scanning and hash lookups for fast verif…

简单
2037

使每位学生都有座位的最少移动次数

Calculate the minimum total moves to seat each student using greedy assignment and invariant validation efficiently.

简单
2042

检查句子中的数字是否递增

Check if the numbers in a sentence are strictly increasing from left to right using string tokenization.

简单
2047

句子中的有效单词数

Count all valid words in a sentence by analyzing each token with precise string-driven validation rules efficiently.

简单
2053

数组中第 K 个独一无二的字符串

Find the kth distinct string in an array by identifying strings that appear only once, using efficient array scanning an…

简单
2057

值相等的最小索引

Find the smallest index where the index mod 10 equals the value at that index in the given array.

简单
2062

统计字符串中的元音子字符串

Count the number of vowel substrings that include all five vowels in a string.

简单
2068

检查两个字符串是否几乎相等

Solve Check Whether Two Strings are Almost Equivalent by counting letters and rejecting any character whose frequency ga…

简单
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.

简单
2085

统计出现过一次的公共字符串

Learn how to efficiently count strings appearing exactly once in both arrays using array scanning and hash lookup patter…

简单
2089

找出数组排序后的目标下标

Find the target indices of a sorted array and return them in increasing order using binary search and sorting techniques…

简单
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.

简单
2103

环和杆

Count how many rods have all three colors using a hash table to track colors per rod efficiently in strings.

简单
2108

找出数组中的第一个回文字符串

Return the first palindromic string from an array of words or an empty string if none exists.

简单
2114

句子中的最多单词数

Find the maximum number of words in a single sentence from an array of sentences using array and string processing techn…

简单
2119

反转两次的数字

Determine if reversing a number twice returns the original integer by analyzing trailing zeros and digit placement.

简单
2124

检查是否所有 A 都在 B 之前

Determine if all 'a's in a string appear before any 'b's using a direct string-driven check strategy for clarity and cor…

简单
2129

将标题首字母大写

Capitalize the Title requires transforming each word based on length, applying uppercase and lowercase rules precisely p…

简单
2133

检查是否每一行每一列都包含全部整数

Determine if every row and column in a square matrix contains all numbers from 1 to n without repetition using array sca…

简单
2138

将字符串拆分为若干长度为 k 的组

Divide a string into equal groups of size k, using a fill character to complete the last group if needed.

简单
2144

打折购买糖果的最小开销

Minimize the total cost of buying candies using a greedy approach with a discount system based on candy prices.

简单
2148

元素计数

Count elements in an array that have both strictly smaller and strictly greater numbers using array sorting efficiently.

简单
2154

将找到的值乘以 2

The "Keep Multiplying Found Values by Two" problem involves repeatedly multiplying a number by two if it is found in an …

简单
2160

拆分数位后四位数字的最小和

Find the minimum sum of two 2-digit numbers by splitting a four-digit number into two integers.

简单
2164

对奇偶下标分别排序

Rearrange a 0-indexed array by sorting even and odd indices independently for predictable order and correctness.

简单
2169

得到 0 的操作数

Simulate operations on two integers until one becomes zero, counting how many steps it takes to achieve the result.

简单
2176

统计数组中相等且可以被整除的数对

Given an array, count pairs of elements that are equal and their indices product is divisible by a given integer.

简单
2180

统计各位数字之和为偶数的整数个数

Solve this Easy Math plus Simulation problem by counting numbers whose digit sums are even up to a given limit efficient…

简单
2185

统计包含给定前缀的字符串

Count how many words in a list start with a given prefix.

简单
2190

数组中紧跟 key 之后出现最频繁的数字

Scan the array once, count which value appears right after the key, and return the uniquely most frequent follower.

简单
2194

Excel 表中某个范围内的单元格

This problem requires extracting a range of cells from an Excel-like sheet based on a string input and returning them in…

简单
2200

找出数组中的所有 K 近邻下标

Identify all indices in an array that are within k distance of elements equal to the given key using two-pointer scannin…

简单
2206

将数组划分成相等数对

Determine if an array of 2n integers can be partitioned into n pairs where each pair contains identical elements using h…

简单
2210

统计数组中峰和谷的数量

Count Hills and Valleys in an Array determines the number of hills and valleys in a given array by analyzing index neigh…

简单
2215

找出两数组的不同

Find the Difference of Two Arrays helps you identify unique elements between two integer arrays using array scanning and…

简单
2220

转换数字的最少位翻转次数

Determine the minimum number of bit flips required to convert one integer to another using precise bit manipulation.

简单
2224

转化时间需要的最少操作数

The problem asks to find the minimum number of operations to convert one time string to another using specific time incr…

简单
2231

按奇偶性交换后的最大数字

Maximize a number by swapping digits of the same parity using sorting and priority queue techniques efficiently.

简单
2235

两整数相加

This problem asks to return the sum of two integers within a specific range, focusing on math-driven solution strategy.

简单
2236

判断根结点是否等于子结点之和

Check if a binary tree root value equals the sum of its immediate left and right child nodes efficiently.

简单
2239

找到最接近 0 的数字

Identify the number in an integer array that is closest to zero, returning the larger one if tied.

简单
2243

计算字符串的数字和

Learn how to repeatedly sum digit groups in a string until its length is at most k using string simulation techniques.

简单
2248

多个数组求交集

Find integers that are common across all arrays in a given list of arrays.

简单
2255

统计是给定字符串前缀的字符串数目

Count Prefixes of a Given String is a problem that involves finding the number of string prefixes in an array that match…

简单
2259

移除指定数字得到的最大结果

Determine the largest possible number by removing one specific digit using a greedy approach and string iteration.

简单
2264

字符串中最大的 3 位相同数字

Find the largest 3-same-digit number within a string of digits using a string-driven solution approach.

简单
2269

找到一个数字的 K 美丽值

Calculate the k-beauty of a number by counting substrings of length k that divide the original number evenly using a sli…

简单
2273

移除字母异位词后的结果数组

This problem requires removing adjacent anagrams from a list of words using an array scanning and hash lookup approach.

简单
2278

字母在字符串中的百分比

Calculate the percentage of a specific letter in a string using a direct string-driven counting approach, rounding down …

简单
2283

判断一个数的数字计数是否等于数位的值

Determine if a number's digits correspond to their counts in the string representation.

简单
2287

重排字符形成目标字符串

Calculate the maximum copies of a target string from letters in s using frequency counting and hash tables efficiently.

简单
2293

极大极小游戏

The Min Max Game problem requires simulating an array reduction process to find the last remaining number.

简单
2299

强密码检验器 II

Check if a given password meets all strength requirements, including length, character types, and no adjacent repeated c…

简单
2303

计算应缴税款总额

Calculate the total tax owed by iterating through sorted brackets and applying each rate incrementally to your income.

简单
2309

兼具大小写的最好英文字母

Find the greatest English letter that exists in both lowercase and uppercase in a string using a hash table approach.

简单
2315

统计星号

The 'Count Asterisks' problem asks you to count '*' excluding those between pairs of '|' in a string.

简单
2319

判断矩阵是否是一个 X 矩阵

Check if a square matrix follows the X-Matrix pattern by validating diagonal and non-diagonal conditions.

简单
2325

解密消息

Decode the Message is an easy problem involving hash table mapping for string decoding based on a cipher key.

简单
2331

计算布尔二叉树的值

Determine the boolean outcome of a full binary tree by evaluating leaf and internal nodes using depth-first traversal.

简单
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.

简单
2347

最好的扑克手牌

Determine the strongest poker hand from five cards using array scanning and hash table counting techniques efficiently.

简单
2351

第一个出现两次的字母

Find the first letter that repeats in a string using hash table tracking and early detection for efficiency.

简单
2357

使数组中所有元素都等于零

Minimize operations to make all array elements zero by subtracting equal amounts in each operation.

简单
2363

合并相似的物品

Merge Similar Items combines values and weights from two lists, returning the result sorted by value.

简单
2367

等差三元组的数目

Count the number of arithmetic triplets in a given strictly increasing array with a specified difference.

简单
2373

矩阵中的局部最大值

Find the largest value in every 3x3 submatrix of an n x n integer matrix efficiently using nested loops.

简单
2379

得到 K 个黑块的最少涂色次数

Given a string of blocks, determine the minimum number of recolors needed to get k consecutive black blocks.

简单
2383

赢得比赛需要的最少训练时长

Find the minimum hours of training needed to beat all opponents in a competition based on energy and experience.

简单
2389

和有限的最长子序列

Find the maximum size of a subsequence from nums with a sum less than or equal to each query value.

简单
2395

和相等的子数组

Find Subarrays With Equal Sum is solved by scanning adjacent pairs and storing each length-2 sum in a hash set.

简单
2399

检查相同字母间的距离

Verify if each pair of identical letters in a string has the exact number of letters between them as specified in a dist…

简单
2404

出现最频繁的偶数元素

Identify the most frequent even element in an array using counting and hash lookup, handling ties by choosing the smalle…

简单
2409

统计共同度过的日子数

Count the total number of days Alice and Bob are in Rome together, given their arrival and departure dates.

简单
2413

最小偶倍数

Find the smallest even multiple of a given integer using math and number theory concepts efficiently.

简单
2418

按身高排序

Sort the People requires pairing names with heights and sorting them in descending height order efficiently using arrays…

简单
2423

删除字符使频率相同

Determine if removing a single letter from a string can make all remaining letters have identical frequency efficiently.

简单
2427

公因子的数目

The problem asks to find the number of common factors of two positive integers a and b.

简单
2432

处理用时最长的那个任务的员工

Identify which employee spent the longest time on a task using an array-driven approach, analyzing each log entry effici…

简单
2437

有效时间的数目

Calculate how many valid digital clock times can be formed by replacing unknown digits in a string format hh:mm.

简单
2441

与对应负数同时存在的最大正整数

Find the largest positive integer in an array such that its negative counterpart also exists.

简单
2446

判断两个事件是否存在冲突

Compare two same-day time intervals and check whether their inclusive endpoints overlap after converting HH:MM strings i…

简单
2451

差值数组不同的字符串

Identify the one string in an array whose consecutive letter differences deviate from all others using array scanning pl…

简单
2455

可被三整除的偶数的平均值

Find the average of even numbers divisible by 3 from an array of positive integers.

简单
2460

对数组执行操作

Transform an array by applying adjacent doubling operations and shifting zeros efficiently using two-pointer scanning te…

简单
2465

不同的平均值数目

Calculate the number of unique averages formed by repeatedly pairing smallest and largest elements efficiently using has…

简单
2469

温度转换

Convert the given Celsius temperature to Kelvin and Fahrenheit using mathematical formulas and return the result in an a…

简单
2475

数组中不等三元组的数目

Count all triplets in a positive integer array where each element is distinct using scanning and hash lookup efficiently…

简单
2481

分割圆的最少切割次数

Calculate the fewest cuts required to divide a circle into n equal slices using math and geometric reasoning efficiently…

简单
2485

找出中枢整数

Find the Pivot Integer problem challenges you to identify an integer x that balances prefix sums on both sides.

简单
2490

回环句

Determine if a sentence is circular by verifying each word's last character matches the next word's first character effi…

简单
2496

数组中字符串的最大值

The problem requires finding the maximum value of alphanumeric strings in an array based on length or numeric value.

简单
2500

删除每行中的最大值

Calculate the total of removed maximum values from each row of a matrix, iterating until all columns are deleted efficie…

简单
2506

统计相似字符串对的数目

Count similar string pairs by converting each word into a character-set signature and counting matching signatures effic…

简单
2511

最多可以摧毁的敌人城堡数目

Find the maximum number of enemy forts that can be captured by moving your army using two-pointer scanning with invarian…

简单
2515

到目标字符串的最短距离

Find the shortest distance to a target string in a circular array with either left or right movement options.

简单
2520

统计能整除数字的位数

Count the digits that divide a number by checking each digit's divisibility.

简单
2525

根据规则将箱子分类

Classify a box as "Heavy", "Bulky", or "Neither" based on its dimensions and mass using math-driven strategies.

简单
2529

正整数和负整数的最大计数

Compute the maximum count between positive and negative integers in a sorted array using efficient binary search countin…

简单
2535

数组元素和与数字和的绝对差

Find the absolute difference between element sum and digit sum of an array of integers.

简单
2540

最小公共值

Find the smallest integer appearing in both sorted arrays efficiently using array scanning and hash-based lookup techniq…

简单
2544

交替数字和

Compute the alternating digit sum by applying a sign to each digit and summing efficiently using a math-driven approach.

简单
2549

统计桌面上的不同数字

Compute the number of distinct integers generated on a board using repeated modulo operations over a long sequence of da…

简单
2553

分割数组中数字的数位

Given an array of positive integers, separate each integer into its individual digits while preserving the original orde…

简单
2558

从数量最多的堆取走礼物

Take Gifts From the Richest Pile uses a heap to simulate the process of taking gifts from the richest pile over a number…

简单
2562

找出数组的串联值

Compute the array concatenation value efficiently using two-pointer scanning while maintaining a running total of concat…

简单
2566

替换一个数字后的最大差值

Find the largest difference by remapping a single digit in a number using a greedy approach to maximize and minimize out…

简单
2570

合并两个二维数组 - 求和法

Merge two 2D arrays by summing values with matching ids using array scanning and hash lookup efficiently.

简单
2574

左右元素和的差值

Compute absolute differences between left and right cumulative sums for each element in an integer array efficiently.

简单
2578

最小和分割

Split a positive integer into two parts to minimize their sum using a greedy approach and sorting.

简单
2582

递枕头

Pass the Pillow simulates the process of passing an item through a line of people, adjusting the direction based on time…

简单
2586

统计范围内的元音字符串数

Count the Number of Vowel Strings in Range asks to count vowel strings in a subarray of a given word list.

简单
2591

将钱分给最多的儿童

Determine the maximum number of children who can each receive exactly 8 dollars using a greedy approach with validation …

简单
2595

奇偶位数

Count the number of 1s at even and odd indices in the binary representation of a given integer n.

简单
2600

K 件物品的最大和

Select k items from a bag containing 1, 0, and -1 to maximize sum using greedy choice and invariant validation strategie…

简单
2605

从两个数字数组里生成最小数字

Given two arrays of digits, find the smallest possible number formed by one digit from each array.

简单
2609

最长平衡子字符串

Find the longest balanced substring of a binary string where zeroes precede ones and counts of each are equal.

简单
2614

对角线上的质数

Find the largest prime number located on any diagonal of a square matrix using array iteration and prime checking techni…

简单
2619

数组原型对象的最后一个元素

Implement a method on all arrays that returns the last element or -1 for empty arrays, using Array.prototype correctly.

简单
2620

计数器

Implement a counter function that returns increasing integers starting from a given initial value with each call, levera…

简单
2621

睡眠函数

Create an asynchronous function that sleeps for a given number of milliseconds and resolves any value.

简单
2626

数组归约运算

Implement the Array Reduce Transformation pattern by applying a reducer function on an array with a given initial value.

简单
2629

复合函数

Learn how to implement function composition by combining multiple functions into a single callable operation efficiently…

简单
2634

过滤数组中的元素

Filter elements from an array based on a custom function using core interview patterns.

简单
2635

转换数组中的每个元素

Transform each element in an array based on a given function without using the built-in Array.map method.

简单
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…

简单
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.

简单
2648

生成斐波那契数列

Implement a generator that produces the Fibonacci sequence up to a specified number of elements efficiently in JavaScrip…

简单
2651

计算列车到站时间

Calculate the new arrival time of a delayed train in 24-hour format by using basic math operations.

简单
2652

倍数求和

Find the sum of integers divisible by 3, 5, or 7 in the range [1, n].

简单
2656

K 个元素的最大和

Maximize your score by performing exactly k operations on an array using a greedy approach to select the highest values.

简单
2660

保龄球游戏的获胜者

Simulate a bowling game to determine the winner based on hit pins per turn for two players.

简单
2665

计数器 II

Implement a counter with functions to increment, decrement, and reset it based on an initial value.

简单
2666

只允许一次函数调用

Learn how to wrap a function so it executes at most once, capturing results while ignoring extra calls efficiently.

简单
2667

创建 Hello World 函数

The Create Hello World Function problem tests a candidate's ability to return a constant value from a function regardles…

简单
2670

找出不同元素数目差数组

Calculate the distinct difference array of a given list of integers by counting distinct elements in the prefix and suff…

简单
2677

分块数组

Chunk Array splits a given array into smaller subarrays of specified size, preserving original element order and handlin…

简单
2678

老人的数目

Determine how many passengers are over 60 years old based on their compressed details in an array of strings.

简单
2682

找出转圈游戏输家

Simulate a ball-passing game around a circle using array scanning and hash lookup to find friends who never receive the …

简单
2695

包装数组

The Array Wrapper problem focuses on implementing a class that wraps an array to perform operations like addition or str…

简单
2696

删除子串后的字符串最小长度

Determine the smallest string length after repeatedly removing AB or CD substrings using stack-based simulation techniqu…

简单
2697

字典序最小回文串

Given a string, make it a palindrome with the fewest operations, prioritizing lexicographically smallest result.

简单
2703

返回传递的参数的长度

Determine the number of arguments passed to a function, practicing direct counting of parameters in real-time function c…

简单
2704

相等还是不相等

Implement a function 'expect' to help developers test values using 'toBe' and 'notToBe' methods.

简单
2706

购买两块巧克力

Determine the leftover money after buying exactly two chocolates using a greedy selection and sum validation approach.

简单
2710

移除字符串中的尾随零

Remove trailing zeros from a string representing a positive integer number.

简单
2715

执行可取消的延迟函数

Learn to implement timeout cancellation logic for function execution using a custom cancel function.

简单
2716

最小化字符串长度

Minimize String Length asks you to reduce a string by removing duplicates using a Hash Table strategy efficiently.

简单
2717

半有序排列

Find the minimum number of operations to convert a permutation into a semi-ordered permutation where 1 is first and n is…

简单
2723

两个 Promise 对象相加

The problem 'Add Two Promises' involves adding the resolved values of two promises and returning the result.

简单
2724

排序方式

Sort By requires sorting an array using a custom function, producing ascending order based on function outputs efficient…

简单
2725

间隔取消

Implement a cancellable function with repeated executions at fixed intervals before a cancellation time.

简单
2726

使用方法链的计算器

Design a Calculator class that supports method chaining for mathematical operations like addition, subtraction, multipli…

简单
2727

判断对象是否为空

Determine if a given object or array is empty by checking its keys or length efficiently in interviews.

简单
2729

判断一个数是否迷人

Determine if a 3-digit number is fascinating by checking if the concatenated result of n, 2*n, and 3*n contains all digi…

简单
2733

既不是最小值也不是最大值

Find a number in an array that is neither the minimum nor maximum value, or return -1 if no such number exists.

简单
2739

总行驶距离

Calculate the maximum distance a truck can travel using main and additional fuel tanks with controlled transfers.

简单
2744

最大字符串配对数目

Find the maximum number of pairs of distinct strings from an array where one string is the reverse of the other.

简单
2748

美丽下标对的数目

Count all index pairs in an array where the first digit of one number and last digit of another are coprime efficiently.

简单
2760

最长奇偶子数组

Determine the length of the longest subarray where elements alternate even and odd while staying below a given threshold…

简单
2765

最长交替子数组

Find the longest alternating subarray in a given array of integers.

简单
2769

找出最大的可达成数字

Determine the largest number achievable by repeatedly applying a simple math operation up to t times efficiently.

简单
2778

特殊元素平方和

Calculate the sum of squares of special elements in a 1-indexed array using index divisibility checks efficiently.

简单
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…

简单
2788

按分隔符拆分字符串

Split Strings by Separator requires iterating through an array of strings and splitting each by a given separator charac…

简单
2798

满足目标工作时长的员工数目

Determine how many employees reach the required work hours using a direct array-driven counting approach.

简单
2806

取整购买后的账户余额

Given a purchase amount, calculate the account balance after rounding the purchase to the nearest multiple of 10 and ded…

简单
2810

故障键盘

Simulate typing on a faulty keyboard where pressing 'i' reverses the string, requiring careful string manipulation track…

简单
2815

数组中的最大数对和

Find the maximum sum of two numbers in an array sharing the same largest digit using a hash-based scan efficiently.

简单
2824

统计和小于目标的下标对数目

This problem asks you to count all index pairs in an array whose sum is strictly less than a given target value efficien…

简单
2828

判别首字母缩略词

Check if a string can be formed by concatenating the first letters of each word in a given list.

简单
2833

距离原点最远的点

Determine the maximum distance from origin using string moves and counting underscores optimally for efficient calculati…

简单
2839

判断通过操作能否让字符串相等 I

Determine if two strings can be made equal by repeatedly swapping characters at any two indices in each string.

简单
2843

统计对称整数的数目

Count Symmetric Integers finds numbers where the sum of the first half of digits equals the sum of the second half withi…

简单
2848

与车相交的点

Count covered integer points by merging overlapping car intervals or marking visited positions on the number line.

简单
2855

使数组成为递增数组的最少右移次数

Determine the minimum number of right shifts to sort a distinct integer array or return -1 if impossible using array ana…

简单
2859

计算 K 置位下标对应元素的和

Sum values in an array where the indices have exactly k set bits in binary representation.

简单
2864

最大二进制奇数

Rearrange a binary string to form the largest odd binary number using a greedy approach and least significant bit valida…

简单
2869

收集元素的最少操作次数

Scan from the end, track seen values from 1 to k, and stop once every required number is collected.

简单
2873

有序三元组中的最大值 I

Find the maximum value of a triplet in an array where indices follow the order i < j < k.

简单
2877

从表中创建 DataFrame

Solve the problem of creating a DataFrame from a list of student data by using the pandas library.

简单
2878

获取 DataFrame 的大小

Learn how to efficiently calculate the number of rows and columns in a DataFrame using Python pandas for interview succe…

简单
2879

显示前三行

Solve a problem where you need to display the first three rows of a DataFrame in Python.

简单
2880

数据选取

Learn to efficiently select specific rows and columns in a dataset using the Select Data core interview pattern for accu…

简单
2881

创建新列

Create a New Column is a simple problem involving DataFrame manipulation, requiring the creation of a new column based o…

简单
2882

删去重复的行

This problem requires removing duplicate rows based on the email column and retaining only the first occurrence.

简单
2883

删去丢失的数据

Remove rows with missing values from a dataset, focusing on the drop missing data pattern.

简单
2884

修改列

Learn how to efficiently modify a DataFrame column by applying a transformation to every value in a single pass.

简单
2885

重命名列

This problem asks you to rename columns in a DataFrame to match a specified format using a built-in function.

简单
2886

改变数据类型

Correct column data types in a DataFrame, focusing on converting float columns to integers efficiently and accurately.

简单
2887

填充缺失值

Fill Missing Data is an easy-level problem that focuses on handling missing values in a dataset.

简单
2888

重塑数据:连结

Concatenate two DataFrames vertically by stacking rows to produce a single combined DataFrame efficiently using pandas.

简单
2889

数据重塑:透视

Learn how to pivot data in a table so each row is a month and each city forms its own column efficiently.

简单
2890

重塑数据:融合

Reshape the data so that each row represents sales data for a product across different quarters.

简单
2891

方法链

In Method Chaining, solve problems using sequential method calls with clean, readable code. Apply this to filter and sor…

简单
2894

分类求和并作差

Compute the difference between sums of integers divisible and non-divisible by m using a direct arithmetic approach effi…

简单
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.

简单
2903

找出满足差值条件的下标 I

Find two indices in an array where their difference in both index and value meets specified thresholds.

简单
2908

元素和最小的山形三元组 I

Find the minimum sum of a mountain triplet in an array of integers, or return -1 if no valid triplet exists.

简单
2913

子数组不同元素数目的平方和 I

Compute the sum of squares of distinct elements for all subarrays using array scanning with hash lookups 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.

简单
2923

找到冠军 I

Find Champion I is an easy problem focusing on identifying the strongest team in a tournament using matrix-based compari…

简单
2928

给小朋友们分糖果 I

Given two integers n and limit, find the number of ways to distribute n candies among 3 children, with no child receivin…

简单
2932

找出强数对的最大异或值 I

Find the maximum XOR of any strong pair in an integer array using array scanning and hash-based lookups efficiently.

简单
2937

使三个字符串相等

Determine the minimum number of operations to make three strings equal by removing rightmost characters from one string …

简单
2942

查找包含给定字符的单词

Identify all indices of words containing a specific character using array and string traversal techniques efficiently.

简单
2946

循环移位后的矩阵相似检查

Determine if a matrix returns to its original state after performing cyclic row shifts k times using array and math patt…

简单
2951

找出峰值

Identify all peaks in a mountain array using direct array enumeration and strict neighbor comparisons efficiently.

简单
2956

找到两个数组中的公共元素

Quickly find all numbers that appear in both arrays using scanning and hash lookup to handle duplicates efficiently.

简单
2960

统计已测试设备

Simulate testing devices based on battery percentages to determine how many pass the test operations in sequence.

简单
2965

找出缺失和重复的数字

Find the missing and repeated numbers in an n x n grid using array scanning and hash lookup.

简单
2970

统计移除递增子数组的数目 I

Count the number of incremovable subarrays in an array by removing them to create a strictly increasing sequence.

简单
2974

最小数字游戏

The Minimum Number Game involves simulating moves by Alice and Bob on an array, sorting elements and appending them to a…

简单
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.

简单
3000

对角线最长的矩形的面积

Find the rectangle with the longest diagonal in a 2D array and return its area, prioritizing maximum area on ties.

简单
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.

简单
3014

输入单词需要的最少按键次数 I

Calculate the minimum pushes to type a word using a remapped telephone keypad with greedy allocation of letters.

简单
3019

按键变更的次数

Count how many times a user switches keys in a typed string, ignoring shift and caps lock variations in characters.

简单
3024

三角形类型

Determine the type of triangle from a three-element array using side sums and equality checks efficiently in constant ti…

简单
3028

边界上的蚂蚁

Solve the problem of counting how often an ant returns to a boundary based on the steps described in the input array.

简单
3033

修改矩阵

Modify the Matrix efficiently by replacing all -1 elements with the maximum in their column using array and matrix opera…

简单
3038

相同分数的最大操作数目 I

Determine the maximum number of operations in an integer array where each operation must produce the same score.

简单
3042

统计前后缀下标对 I

Count all index pairs where one word is both a prefix and suffix of another, using efficient array and string checks.

简单
3046

分割数组

Determine if an even-length array can be split into two parts with all distinct elements using hash lookup scanning.

简单
3065

超过阈值的最少操作数 I

Count how many numbers are below k, because each such value must be removed in Minimum Operations to Exceed Threshold Va…

简单
3069

将元素分配到两个数组中 I

Distribute elements from a distinct integer array into two subarrays using a sequential simulation strategy for optimal …

简单
3074

重新分装苹果

Distribute packs of apples into boxes using a greedy strategy, minimizing the number of boxes selected efficiently and c…

简单
3079

求出加密整数的和

Compute the sum of encrypted integers by replacing each digit with the largest digit, combining array traversal with dig…

简单
3083

字符串及其反转中是否存在同一子字符串

Check for any substring of length 2 in a string and its reverse using a hash table and string comparison.

简单
3090

每个字符最多出现两次的最长子字符串

Find the maximum length substring where some substring occurs at least twice using a sliding window and hash mapping str…

简单
3095

或值至少 K 的最短子数组 I

Find the shortest non-empty subarray in nums whose bitwise OR reaches at least k using sliding window efficiently.

简单
3099

哈沙德数

Given an integer, determine if it is a Harshad number by checking if it's divisible by the sum of its digits.

简单
3105

最长的严格递增或递减子数组

Find the longest subarray in a given array that is either strictly increasing or strictly decreasing.

简单
3110

字符串的分数

Calculate the sum of absolute ASCII differences between adjacent characters to score any given string efficiently.

简单
3114

替换字符可以得到的最晚时间

Given a time string with "?" characters, replace them to form the latest valid 12-hour time.

简单
3120

统计特殊字母的数量 I

Count the number of special characters in a given string using hash tables and string manipulation.

简单
3127

构造相同颜色的正方形

Determine if a 3x3 grid can form a 2x2 square of the same color by changing at most one cell efficiently.

简单
3131

找出与数组相加的整数 I

Find the integer added to nums1 to make it equal to nums2 using an array-driven strategy.

简单
3136

有效单词

Determine if a given string qualifies as a valid word using a string-driven solution pattern with explicit character rul…

简单
3142

判断矩阵是否满足条件

Check if a grid satisfies given conditions by analyzing array and matrix structure with specific checks on values.

简单
3146

两个字符串的排列差

Compute the total index difference between two strings by mapping characters and summing their positional distances effi…

简单
3151

特殊数组 I

Determine if an array is special by checking alternating parity for every adjacent pair in linear time.

简单
3158

求出出现两次数字的 XOR 值

Find the XOR of numbers appearing twice by scanning the array and using a hash table for efficient tracking and combinat…

简单
3162

优质数对的总数 I

Count all good pairs where an element in nums1 is divisible by a scaled element in nums2 using efficient array scanning.

简单
3168

候诊室中的最少椅子数

Calculate the minimum number of chairs needed in a waiting room using string simulation and event tracking efficiently.

简单
3174

清除数字

Remove all digits from a given string by applying a repeated operation to form the final string without digits.

简单
3178

找出 K 秒后拿着球的孩子

Find the child who holds the ball after k seconds of passing in a queue, considering reversals at both ends.

简单
3184

构成整天的下标对数目 I

Count all pairs in an array where their sum forms a complete day using hash-based counting for efficiency.

简单
3190

使所有元素都可以被 3 整除的最少操作数

Find the minimum number of operations to make all elements in an array divisible by three.

简单
3194

最小元素和最大元素的最小平均值

Solve the Minimum Average of Smallest and Largest Elements problem using two-pointer scanning to track averages effectiv…

简单
3200

三角形的最大高度

Find the maximum height of a triangle that can be formed using red and blue balls under given constraints.

简单
3206

交替组 I

Count all alternating groups in a circular array by tracking tiles with distinct neighbors efficiently using sliding win…

简单
3210

找出加密后的字符串

In this problem, you need to encrypt a string by shifting each character's position based on a given integer value.

简单
3216

交换后字典序最小的字符串

Lexicographically Smallest String After a Swap involves finding the smallest string after swapping adjacent digits with …

简单
3222

求出硬币游戏的赢家

In this game between Alice and Bob, players must pick coins summing to 115. Alice starts, and the goal is to determine t…

简单
3226

使两个整数相等的位更改次数

Find the number of bit changes to make two integers equal using bit manipulation techniques.

简单
3232

判断是否可以赢得数字游戏

Determine if Alice can guarantee a win in a game by selectively summing single or double-digit numbers from an array.

简单
3238

求出胜利玩家的数目

Find how many players in a game win by picking more balls of a single color than their index position.

简单
3242

设计相邻元素求和服务

Design a service that computes sums for adjacent and diagonal elements in a 2D grid.

简单
3248

矩阵中的蛇

Solve the Snake in Matrix problem by simulating the snake's movement in a grid based on a series of directional commands…

简单
3258

统计满足 K 约束的子字符串数量 I

Count all substrings in a binary string that meet a given k-constraint using an efficient sliding window approach.

简单
3264

K 次乘运算后的最终数组 I

Solve the problem of determining the final state of an array after multiple multiplication operations using a priority q…

简单
3270

求出数字答案

Determine the four-digit key from three given numbers using a precise math-driven approach for exact digit alignment.

简单
3274

检查棋盘方格颜色是否相同

Determine if two chessboard squares share the same color using coordinate math and simple string manipulation for quick …

简单
3280

将日期转换为二进制表示

Convert a given Gregorian date string to its binary format by transforming year, month, and day individually without lea…

简单
3285

找到稳定山的下标

Find the indices of stable mountains in an array of mountain heights based on a threshold.

简单
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…

简单
3300

替换为数位和以后的最小元素

Replace each number with its digit sum and return the smallest resulting value, using array plus math techniques efficie…

简单
3304

找出第 K 个字符 I

Find the K-th character in a progressively built string using math and bit manipulation efficiently.

简单
3314

构造最小位运算数组 I

Learn how to construct an array minimizing each element while matching given primes using bitwise operations efficiently…

简单
3318

计算子数组的 x-sum I

Compute the x-sum of every subarray of length k efficiently using array scanning combined with hash lookup techniques.

简单
3330

找到初始输入字符串 I

Determine the length of the original string Alice intended to type by analyzing repeated characters and clumsy key press…

简单
3340

检查平衡字符串

Determine if a numeric string is balanced by comparing sums of digits at even and odd positions efficiently.

简单
3345

最小可整除数位乘积 I

Find the smallest number greater than or equal to n whose digit product is divisible by t.

简单
3349

检测相邻递增子数组 I

Check if an array contains two adjacent strictly increasing subarrays of length k using an array-driven approach efficie…

简单
3354

使数组元素等于零

Learn how to transform an integer array to zeros using simulation and directional selection efficiently and reliably.

简单
3360

移除石头游戏

Alice and Bob play a game of stone removal. Alice goes first, and the winner is the player who can make a move until the…

简单
3364

最小正和子数组

Find the minimum sum of any subarray of size between l and r with a positive total using efficient sliding window logic.

简单
3370

仅含置位位的最小整数

Find the smallest number greater than or equal to n with all set bits in its binary representation.

简单
3375

使数组的值全部为 K 的最少操作次数

Find the minimum operations to convert an array to all values equal k using array scanning and hash lookup efficiently.

简单
3379

转换数组

Simulate operations on a circular array to return a transformed result array following specific rules.

简单
3386

按下时间最长的按钮

Determine which button a child pressed the longest using an array-driven strategy to track time differences efficiently.

简单
3392

统计符合条件长度为 3 的子数组数目

Determine how many subarrays of length three satisfy a sum condition on their first and third elements in an array.

简单
3396

使数组元素互不相同所需的最少操作次数

Find the minimum number of operations to make all elements of an array distinct.

简单
3402

使每一列严格递增的最少操作次数

Calculate the minimum increments to make each column of a matrix strictly increasing using a greedy invariant approach.

简单
3407

子字符串匹配模式

Determine if a pattern containing a single wildcard can match any substring of a given string efficiently.

简单
3411

最长乘积等价子数组

This problem involves finding the longest subarray where the product equals the LCM multiplied by the GCD, leveraging a …

简单
3417

跳过交替单元格的之字形遍历

Traverse a 2D grid in a zigzag pattern while skipping alternate cells, focusing on array and matrix manipulation challen…

简单
3423

循环数组中相邻元素的最大差值

Find the maximum absolute difference between adjacent elements in a circular array using a straightforward array-driven …

简单
3427

变长子数组求和

Calculate the total sum of all elements in subarrays defined for each index in an array, using the array plus prefix sum…

简单
3432

统计元素和差值为偶数的分区方案

Count the number of partitions with an even sum difference from an array of integers.

简单
3438

找到字符串中合法的相邻数字

Identify the first valid adjacent digit pair in a string where each digit appears exactly as many times as its numeric v…

简单
3442

奇偶频次间的最大差值 I

Find the maximum difference between the frequency of characters in a string with odd and even frequencies.

简单
3452

好数字之和

The problem asks for the sum of all good numbers in an array based on specific conditions of neighboring elements.

简单
3456

找出长度为 K 的特殊子字符串

Check efficiently if a string contains a consecutive sequence of length k where all characters match exactly one distinc…

简单
3461

判断操作后字符串中的数字是否相等 I

Simulate repeated adjacent digit sums modulo 10 until two digits remain, then check whether those final digits match.

简单
3467

将数组按照奇偶性转化

Transform an array by sorting even numbers first, followed by odd numbers.

简单
3471

找出最大的几近缺失整数

Find the largest almost missing integer in an array where it appears in exactly one subarray of size k.

简单
3477

水果成篮 II

Determine the number of fruit types that remain unplaced after all allocations in the "Fruits Into Baskets II" problem.

简单
3483

不同三位偶数的数目

Given an array of digits, find how many distinct 3-digit even numbers can be formed without repetition of digits and no …

简单
3487

删除后的最大子数组元素和

Maximize the sum of a subarray after performing deletions, ensuring elements remain unique.

简单
3492

船上可以装载的最大集装箱数量

Determine the maximum number of containers that can be loaded onto a ship's deck without exceeding weight limits.

简单
3498

字符串的反转度

Calculate the reverse degree of a string by simulating operations on its characters based on their positions in the alph…

简单
3502

到达每个位置的最小费用

Calculate the minimum swap costs to reach each position in a line using a precise array-driven strategy for efficiency.

简单
3507

移除最小数对使数组有序 I

This problem asks for 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.

简单
3516

找到最近的人

Determine which of two people reaches a third person first using a simple math-driven distance comparison strategy.

简单
3536

两个数字的最大乘积

Find the highest product obtainable from any two digits of a given positive integer using math and sorting techniques ef…

简单
3541

找到频率最高的元音和辅音

Given a string, calculate the sum of the most frequent vowel and consonant frequencies.

简单
3545

不同字符数量最多为 K 时的最少删除数

You need to delete characters in a string to reduce its distinct characters to at most k.

简单
3550

数位和等于下标的最小下标

Find the smallest index in an array where the sum of the digits equals the index.

简单
3560

木材运输的最小成本

Calculate the minimum cost to transport two logs using a math-driven strategy considering cutting costs and truck limits…

简单
3582

为视频标题生成标签

Transform a video caption into a valid hashtag by simulating capitalization rules and truncation for long words efficien…

简单
3591

检查元素频次是否为质数

Check if any element in the array has a prime frequency count, leveraging array scanning and hash table lookup.

简单
3602

十六进制和三十六进制转化

Solve Hexadecimal and Hexatrigesimal Conversion by converting n squared to base 16 and n cubed to base 36, then joining …

简单
3606

优惠券校验器

The Coupon Code Validator problem requires filtering and sorting coupons based on specific criteria for validity.

简单
3622

判断整除性

Determine if a positive integer is divisible by the sum of its digits plus their product using a math-driven strategy.

简单
3633

最早完成陆地和水上游乐设施的时间 I

Find the earliest time a tourist can finish one land and one water ride in a theme park.

简单
3637

三段式数组 I

Determine if an integer array contains indices forming a trionic sequence for efficient pattern detection in interviews.

简单

该难度高频题型

route

Guided Practice Path

AI recommends problems by your level and tracks your progress.

Start Guided Patharrow_forward
LeetCode 简单难度题解