训练重点
优先稳定基础题感和解释节奏。
建议节奏
每轮 3-5 题,先口述思路再写代码,最后复盘错误路径。
搭配建议
结合模式页和题型页同步练,能更快形成可迁移能力。
两数之和
Two Sum is solved fastest by storing seen values in a hash map and checking each number's needed complement once.
回文数
Determine if a given integer reads the same forward and backward using a math-driven solution strategy without convertin…
罗马数字转整数
Convert a Roman numeral string into an integer using a hash table and mathematical principles to determine value order.
最长公共前缀
Find the longest common prefix in an array of strings, returning an empty string if none exists.
有效的括号
Determine if a string of parentheses, brackets, and braces is correctly nested using a stack for proper order validation…
合并两个有序链表
Merge two sorted linked lists by splicing nodes into one sorted list using linked-list pointer manipulation and recursio…
删除有序数组中的重复项
Learn how to remove duplicates from a sorted array in-place using two-pointer scanning while preserving element order.
移除元素
Remove Element challenges you to remove a value from an array in-place using efficient two-pointer scanning and tracking…
找出字符串中第一个匹配项的下标
Locate the first occurrence of a substring within a string using a two-pointer scanning strategy and invariant tracking …
搜索插入位置
Find the correct index for a target value in a sorted array using binary search, or return the position where it should …
最后一个单词的长度
Determine the length of the last word in a string using a focused string-driven approach to handle spaces and trailing c…
加一
Given a number as an array of digits, increment it by one and return the updated array of digits.
二进制求和
Add Binary involves summing two binary strings and returning the result as a binary string using math and string manipul…
x 的平方根
Solve the Sqrt(x) problem using binary search to find the integer square root of a number without built-in operators.
爬楼梯
Climbing Stairs is a classic dynamic programming problem where you calculate distinct ways to reach the top using step t…
删除排序链表中的重复元素
Efficiently remove duplicates from a sorted linked list using precise pointer manipulation while maintaining node order …
合并两个有序数组
Merge two sorted arrays into the first array in non-decreasing order, using a two-pointer approach.
二叉树的中序遍历
Binary Tree Inorder Traversal asks you to visit left subtree, node, then right subtree without losing position while mov…
相同的树
Check whether two binary trees are identical by comparing structure and node values using DFS or BFS traversal strategie…
对称二叉树
Determine if a binary tree is symmetric by comparing left and right subtrees using DFS or BFS traversal techniques effic…
二叉树的最大深度
Find the maximum depth of a binary tree using traversal techniques to track the longest path from root to leaf.
将有序数组转换为二叉搜索树
Pick the middle element as root at each step so the sorted array becomes a height-balanced BST with valid ordering.
平衡二叉树
Determine if a binary tree is height-balanced using tree traversal and state tracking techniques.
二叉树的最小深度
Find the minimum depth of a binary tree, which is the shortest path from the root node to the nearest leaf node.
路径总和
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 …
杨辉三角
Generate the first numRows of Pascal's Triangle using dynamic programming with clear state transitions and array manipul…
杨辉三角 II
Compute the specific row of Pascal's Triangle using efficient state transition dynamic programming with array-based upda…
买卖股票的最佳时机
Maximize stock profit by identifying the optimal buy and sell days using dynamic programming.
验证回文串
Check if a given string is a valid palindrome by using two-pointer scanning and invariant tracking techniques.
只出现一次的数字
Solve the Single Number problem using an efficient approach with constant space and linear time complexity.
环形链表
Determine if a given linked list contains a cycle using pointer manipulation or hashing, focusing on detecting repeated …
二叉树的前序遍历
Perform a binary tree preorder traversal by visiting root nodes first, then left and right subtrees, tracking state iter…
二叉树的后序遍历
Solve Binary Tree Postorder Traversal using state tracking and binary-tree traversal techniques, focusing on Stack, Tree…
相交链表
Given two linked lists, find the node where they intersect or return null if they do not.
Excel 表列名称
Convert a positive integer to its corresponding Excel column title using base-26 math and string manipulation efficientl…
多数元素
Find the majority element in an array, where the element appears more than n/2 times, using efficient algorithms.
Excel 表列序号
This problem requires converting an Excel column title into its corresponding column number by applying a math and strin…
颠倒二进制位
Reverse a 32-bit unsigned integer by manipulating bits efficiently using a divide and conquer approach with careful bit …
位1的个数
Number of 1 Bits is a classic bit manipulation problem where clearing the lowest set bit gives the cleanest count.
快乐数
Determine if a number is happy by repeatedly summing squares of digits using two-pointer scanning to detect cycles effic…
移除链表元素
Remove all nodes from a linked list that have a specific value, adjusting pointers to preserve the rest of the list.
同构字符串
Determine if two strings are isomorphic by checking if one string can be transformed into the other using character repl…
反转链表
Reverse a singly linked list in place, converting the head to tail, with an iterative or recursive approach.
存在重复元素
Determine if an integer array contains any duplicate values by efficiently scanning with a hash lookup to ensure fast de…
存在重复元素 II
Check if any two equal numbers exist within k indices using array scanning and hash table lookup efficiently.
完全二叉树的节点个数
Count Complete Tree Nodes efficiently by leveraging binary-tree traversal, exploiting completeness, and applying bit man…
用队列实现栈
This problem tests your ability to simulate a LIFO stack using two queues while preserving all standard stack operations…
翻转二叉树
Invert Binary Tree swaps every node's left and right children using tree traversal, with recursive DFS or iterative BFS …
汇总区间
Summary Ranges involves converting a sorted array of unique integers into a minimal list of range strings.
2 的幂
Determine if a given integer is a power of two using efficient math and bit manipulation techniques with optional recurs…
用栈实现队列
Implement a queue using two stacks, focusing on stack-based state management to achieve FIFO behavior in a queue.
回文链表
Solve Palindrome Linked List by finding the midpoint, reversing the second half, and comparing mirrored nodes in linear …
有效的字母异位词
Check if two strings are anagrams using hashing or sorting techniques.
二叉树的所有路径
Find all root-to-leaf paths in a binary tree using DFS and backtracking, constructing strings for each complete path eff…
各位相加
Add Digits involves repeatedly summing digits of a number until a single digit is obtained.
丑数
The Ugly Number problem asks you to determine if a number is divisible only by 2, 3, or 5.
丢失的数字
Find the missing number in an array containing distinct numbers in the range [0, n].
第一个错误的版本
Find the first bad version of a product using binary search, minimizing the number of API calls.
移动零
Move all zeros in an array to the end while preserving the order of non-zero elements using efficient in-place operation…
单词规律
Solve Word Pattern by checking a one-to-one mapping between pattern letters and words using hash tables after splitting …
Nim 游戏
In Nim Game, determine if you can win given a certain number of stones, assuming optimal play from both players.
区域和检索 - 数组不可变
The Range Sum Query - Immutable problem involves implementing a data structure to handle range sum queries efficiently.
3 的幂
Determine if a given integer is a power of three using math and recursion techniques.
比特位计数
Compute the number of 1 bits for every integer from 0 to n using state transition dynamic programming for efficiency.
4的幂
Determine if a given integer is a power of four using math insights and bit manipulation tricks efficiently in code.
反转字符串
Reverse a character array in-place using a two-pointer scanning technique, ensuring minimal memory and correct index swa…
反转字符串中的元音字母
Reverse Vowels of a String uses a two-pointer approach to reverse the vowels in a string while leaving the consonants in…
两个数组的交集
Find the intersection of two arrays while ensuring unique elements using efficient array scanning and hash lookups.
两个数组的交集 II
Find the intersection of two arrays, accounting for multiple occurrences of the same number.
有效的完全平方数
Determine if a given positive integer is a perfect square using a binary search approach over potential square roots eff…
猜数字大小
Find the picked number efficiently using binary search while adjusting guesses based on higher or lower feedback in this…
赎金信
Determine if a ransom note can be constructed from a magazine's letters using hash tables and string counting techniques…
字符串中的第一个唯一字符
Find the index of the first non-repeating character in a string using efficient queue-driven state processing.
找不同
Find the Difference involves identifying the additional letter in one string compared to another, emphasizing hash table…
判断子序列
Determine if one string is a subsequence of another using state transition dynamic programming for accurate character ma…
二进制手表
Binary Watch involves generating possible times on a binary watch given a number of turned-on LEDs.
左叶子之和
Compute the total of all left leaves in a binary tree using precise traversal and state tracking techniques for correctn…
数字转换为十六进制数
Convert a 32-bit integer to its hexadecimal string using math operations and careful string manipulation techniques.
最长回文串
Determine the length of the longest palindrome constructible from a given string using greedy counting and frequency tra…
Fizz Buzz
Generate a list from 1 to n replacing multiples of 3 with Fizz, 5 with Buzz, and both with FizzBuzz efficiently.
第三大的数
Find the third distinct maximum number in an array using array traversal and sorting techniques, handling duplicates car…
字符串相加
Given two non-negative integers as strings, sum them and return the result as a string without converting to integers di…
字符串中的单词数
Count the segments of non-space characters in a string by applying a string-driven approach to solve the problem.
排列硬币
Determine the maximum number of complete staircase rows possible with n coins using a binary search approach.
找到所有数组中消失的数字
Identify all missing numbers in an array using efficient scanning and hash-based lookup for optimal performance.
分发饼干
Maximize content children by assigning at most one cookie per child using two-pointer scanning and greedy sorting techni…
重复的子字符串
Check if a string can be constructed by repeating a substring using string matching techniques.
汉明距离
Calculate the Hamming distance between two integers by counting differing bit positions.
岛屿的周长
Determine the perimeter of an island in a grid of land and water cells using DFS or BFS.
数字的补数
The Number Complement problem requires flipping bits in a number’s binary representation to return its complement.
密钥格式化
Reformat a license key string by splitting into groups of size k, converting to uppercase, and handling dashes appropria…
最大连续 1 的个数
Find the maximum sequence of consecutive 1s in a binary array using an efficient array-driven scanning approach.
构造矩形
Given an area, design a rectangle with integer length and width optimizing L >= W and minimal difference, using math.
提莫攻击
Compute the total poisoned time Ashe experiences from Teemo's attacks using an array-based simulation approach efficient…
下一个更大元素 I
Find the next greater element for each number in nums1 from the nums2 array using an optimized approach.
键盘行
Identify all words from a list that can be typed using letters from only one row of a standard American keyboard.
二叉搜索树中的众数
Find Mode in Binary Search Tree asks to identify the most frequent element(s) in a BST using binary-tree traversal.
七进制数
Convert any given integer to its base 7 string representation using efficient math and string manipulation techniques.
相对名次
Solve Relative Ranks by sorting scores with original indices, then writing medal labels or numeric places back in answer…
完美数
Check if a given number is a perfect number by verifying if it's equal to the sum of its divisors, excluding itself.
斐波那契数
Calculate the nth Fibonacci number using state transition dynamic programming and recursive techniques efficiently in in…
检测大写字母
Detect Capital asks you to determine if a word follows a correct capital usage pattern based on specific rules.
最长特殊序列 Ⅰ
Determine the length of the longest uncommon subsequence between two strings using a direct string comparison strategy.
二叉搜索树的最小绝对差
Find the minimum absolute difference between values of any two nodes in a BST using tree traversal and careful state tra…
反转字符串 II
Reverse String II requires reversing segments of a string using two-pointer scanning while tracking invariants carefully…
二叉树的直径
The Diameter of Binary Tree problem involves finding the longest path between any two nodes using tree traversal techniq…
学生出勤记录 I
Determine if a student's attendance record qualifies for an award based on specific criteria for absences and lateness.
反转字符串中的单词 III
Reverse Words in a String III involves reversing each word in a sentence using the two-pointer technique.
N 叉树的最大深度
Find the maximum depth of an N-ary tree, leveraging tree traversal techniques and state tracking.
数组拆分
Maximize the sum of minimums of n pairs in a 2n integer array using a greedy pairing strategy efficiently.
二叉树的坡度
Calculate the sum of the binary tree's node tilts using tree traversal and state tracking.
重塑矩阵
Reshape the Matrix involves transforming a 2D matrix into a new matrix with the same elements in row-major order, follow…
另一棵树的子树
Determine if one binary tree is an exact subtree of another by comparing structure and node values recursively.
分糖果
Maximize the number of different candies Alice can eat given a set of candies and constraints on quantity.
N 叉树的前序遍历
Solve the N-ary Tree Preorder Traversal problem using depth-first search and stack-based traversal methods.
N 叉树的后序遍历
Postorder traversal of an N-ary tree can be efficiently solved using DFS and stack-based methods, tracking state across …
最长和谐子序列
Find the length of the longest harmonious subsequence in an integer array using array scanning and hash-based frequency …
区间加法 II
Range Addition II requires counting maximum values in a matrix after incremental operations using array and math reasoni…
两个列表的最小索引总和
Find the common strings between two lists with the smallest index sum in this easy problem involving array scanning and …
种花问题
Determine if n new flowers can be planted in a flowerbed, ensuring no adjacent flowers using a greedy approach.
合并二叉树
Merge Two Binary Trees requires combining nodes by summing overlapping values while preserving non-null nodes from eithe…
三个数的最大乘积
Find three numbers in an array whose product is the largest using sorting and careful handling of negative values.
二叉树的层平均值
Calculate the average value of nodes on each level of a binary tree using traversal and state tracking.
子数组最大平均数 I
Find the maximum average of any contiguous subarray of length k in a given integer array using a sliding window approach…
错误的集合
Identify the duplicated and missing numbers in an integer array using array scanning combined with hash table lookup eff…
两数之和 IV - 输入二叉搜索树
Determine if a binary search tree contains two nodes whose values sum to a target using efficient traversal and state tr…
机器人能否返回原点
Judge whether a robot returns to the origin after a sequence of moves using string manipulation and simulation.
图片平滑器
Apply a 3x3 smoothing filter to a matrix, rounding down each cell average including surrounding neighbors for accurate r…
二叉树中第二小的节点
Find the second minimum node in a binary tree by traversing the tree and tracking state.
最长连续递增序列
Find the length of the longest continuous increasing subsequence in an unsorted integer array using an array-driven solu…
验证回文串 II
Check if a string can become a palindrome by deleting at most one character using two-pointer scanning and invariant tra…
棒球比赛
Simulate baseball score operations using a stack-based approach to compute the final score after all operations.
交替位二进制数
Check whether a given integer has alternating bits using a bit manipulation approach.
计数二进制子串
Count Binary Substrings solves for the number of valid substrings with equal 0's and 1's, grouped consecutively in a bin…
数组的度
Find the shortest subarray with the same degree as the given array using efficient array scanning and hash lookups.
二叉搜索树中的搜索
Locate a target value in a binary search tree and return the subtree rooted at that node using efficient tree traversal …
数据流中的第 K 大元素
Find the kth largest element in a dynamic stream using binary-tree traversal and efficient state tracking with a min-hea…
二分查找
Solve the Binary Search problem by finding the index of a target value in a sorted array with O(log n) complexity.
设计哈希集合
Implement a custom HashSet without built-in libraries using array scanning and hash lookup for efficient membership chec…
设计哈希映射
Implement a custom HashMap from scratch using array scanning and hash lookup without built-in libraries for efficient ke…
转换成小写字母
The "To Lower Case" problem asks you to convert all uppercase letters in a string to lowercase.
1 比特与 2 比特字符
Determine whether the last character in a binary array represents a one-bit character or a two-bit character.
寻找数组的中心下标
Find the pivot index in an array where the sums of elements on both sides are equal using array and prefix sum technique…
自除数
Identify self-dividing numbers in a given range by verifying divisibility against their digits.
图像渲染
Flood Fill is an array and DFS problem where you change connected pixels to a target color efficiently using recursion o…
寻找比目标字母大的最小字母
Locate the smallest character in a sorted array that is strictly greater than a given target using efficient binary sear…
使用最小花费爬楼梯
Compute the minimum cost to reach the top of a staircase using dynamic programming and step-by-step state transitions ef…
至少是其他数字两倍的最大数
Determine if the largest number in the array is at least twice as large as every other element, and return its index or …
最短补全词
Find the shortest word that completes the license plate by matching all required letters, considering frequency and case…
二进制表示中质数个计算置位
Count numbers with prime set bits in a binary representation within a given range.
托普利茨矩阵
Determine if a given matrix is a Toeplitz matrix by checking diagonal consistency.
宝石与石头
Given two strings, determine how many of the stones you have are also jewels, considering case sensitivity.
二叉搜索树节点最小距离
Find the minimum difference between values of two different nodes in a Binary Search Tree using tree traversal and state…
旋转字符串
Determine if one string can be rotated into another by repeatedly shifting characters, leveraging string matching techni…
唯一摩尔斯密码词
Determine how many unique Morse code transformations can be generated from a list of words using a hash table and array …
写字符串需要的行数
Calculate how many lines are needed to write a string given individual letter widths, constrained to 100 pixels per line…
最大三角形面积
Find the area of the largest triangle formed by three distinct points on a 2D plane.
最常见的单词
Find the most frequent non-banned word in a paragraph, excluding punctuation, using an efficient array scan and hash tab…
字符的最短距离
Compute the minimum distance from each character in a string to a target character using efficient scanning techniques.
山羊拉丁文
Convert a sentence to Goat Latin by transforming each word based on vowel rules and incremental suffixes efficiently.
较大分组的位置
Identify and return intervals of consecutive, large character groups in a string of lowercase letters.
翻转图像
Flip each row of a binary matrix horizontally and invert its values efficiently using a two-pointer scanning approach.
矩形重叠
Determine if two axis-aligned rectangles overlap based on their coordinates.
比较含退格的字符串
Compare two strings after processing backspaces using efficient two-pointer scanning and careful invariant tracking to e…
亲密字符串
Determine if two strings can become equal by swapping exactly two letters using a hash table for character tracking.
柠檬水找零
Determine if you can provide exact change to every customer at a lemonade stand using greedy bill management techniques.
转置矩阵
Transpose Matrix problem requires flipping a matrix's rows and columns to return the transposed version.
二进制间距
Find the maximum distance between consecutive 1's in a number's binary form using precise bit manipulation techniques.
叶子相似的树
Determine if two binary trees have identical leaf sequences using efficient traversal and state tracking techniques.
链表的中间结点
Find the middle node of a singly linked list using a two-pointer technique.
三维形体投影面积
Calculate the projection area of a 3D shape defined by a grid of towers with varying heights.
两句话中的不常见单词
Find uncommon words from two sentences by counting word frequencies using hash tables.
公平的糖果交换
Determine which single candy box Alice and Bob should swap to equalize their total candies using array scanning and hash…
三维形体的表面积
Solve the Surface Area of 3D Shapes problem using array manipulation and mathematical formulas to calculate surface area…
单调数列
Determine if an integer array is entirely monotone increasing or decreasing using a clear array-driven approach.
递增顺序搜索树
Rearrange a binary search tree so all nodes follow increasing order with only right children using in-order traversal.
按奇偶排序数组
Reorder an integer array so all even numbers come before odd numbers using a precise two-pointer scanning method.
最小差值 I
Find the smallest score of an array after applying an operation to each element within a given range.
卡牌分组
Solve the problem of determining if a deck can be partitioned into groups with equal occurrences of card values.
仅仅反转字母
Reverse the characters of a string while skipping non-letter characters using a two-pointer technique.
按奇偶排序数组 II
Sort an array where even numbers appear at even indices and odd numbers appear at odd indices using two-pointer scanning…
长按键入
Check if a typed string could result from long pressing characters while typing a given name using a two-pointer scan.
独特的电子邮件地址
Identify the count of unique email addresses by normalizing local names and using hash-based lookups efficiently.
最近的请求次数
The "Number of Recent Calls" problem involves designing a class to efficiently track recent requests within a time windo…
二叉搜索树的范围和
Given a BST and a range, calculate the sum of all node values within that range.
有效的山脉数组
The 'Valid Mountain Array' problem requires determining if an array meets the conditions of a valid mountain array using…
增减字符串匹配
Reconstruct a permutation from a DI string using two-pointer scanning, carefully tracking the increasing and decreasing …
删列造序
The 'Delete Columns to Make Sorted' problem asks to remove unsorted columns from a string array, ensuring all columns ar…
验证外星语词典
Verify if a sequence of words is sorted according to an alien language's custom alphabet order using array scanning and …
在长度 2N 的数组中找出重复 N 次的元素
Find the element that is repeated exactly N times in a 2N-sized array using array scanning and hash lookups.
单值二叉树
Determine if a binary tree is uni-valued using traversal and state tracking techniques.
三角形的最大周长
Given an integer array, find the largest perimeter of a triangle formed from three of these lengths.
有序数组的平方
The problem involves squaring elements of a sorted array and returning the squares in non-decreasing order.
数组形式的整数加法
Compute the sum of an integer and a number represented as an array, efficiently handling digit carries and array travers…
二叉树的堂兄弟节点
Determine if two nodes in a binary tree are cousins by leveraging binary-tree traversal and state tracking.
找到小镇的法官
Find the Town Judge is an easy LeetCode problem that challenges you to identify a town judge from trust relationships us…
可以被一步捕获的棋子数
This problem involves finding the number of pawns a rook can capture on a chessboard, considering obstacles like bishops…
查找共用字符
Return an array of common characters from all strings in the given list of words, including duplicates.
K 次取反后最大化的数组和
Maximize the sum of an integer array after exactly k negations using a greedy approach and invariant tracking for optima…
十进制整数的反码
In this problem, you need to return the complement of a given integer by flipping its binary digits.
将数组分成和相等的三个部分
Determine if an array can be partitioned into three non-empty parts with equal sum using greedy choice and validation.
可被 5 整除的二进制前缀
Determine which binary prefixes of a given array are divisible by 5 using bit manipulation for efficient checks.
删除最外层的括号
Remove Outermost Parentheses simplifies a valid parentheses string by removing the outermost layers of parentheses in ea…
从根到叶的二进制数之和
Calculate the sum of binary numbers from root to leaf paths in a binary tree.
除数博弈
Divisor Game is a game theory problem where players take turns subtracting divisors of a number n until one player loses…
距离顺序排列矩阵单元格
Compute all matrix cell coordinates sorted by Manhattan distance from a given center using array and math techniques eff…
有效的回旋镖
Determine if three points on a 2D plane form a boomerang, based on distinctness and non-collinearity.
最后一块石头的重量
In the 'Last Stone Weight' problem, we smash the two heaviest stones until one remains, using heaps or sorting.
删除字符串中的所有相邻重复项
Solve Remove All Adjacent Duplicates In String by simulating deletions with a stack that collapses matching neighbors im…
高度检查器
Determine how many students are out of place in a line by comparing their heights to the sorted expected order efficient…
字符串的最大公因子
Find the greatest common divisor string between two strings based on the math and string patterns.
Bigram 分词
Extract the third word in every adjacent triple of words matching a given bigram pattern from a text.
复写零
Duplicate each zero in a fixed-length array in place, shifting elements right using a two-pointer scanning approach effi…
分糖果 II
Distribute candies to people in a way that follows a mathematical pattern, ensuring the distribution is correct.
IP 地址无效化
Transform an IPv4 address by replacing each period with '[.]', focusing on a string-driven, direct manipulation approach…
数组的相对排序
Sort arr1 by the relative order of arr2, with remaining elements placed in ascending order.
等价多米诺骨牌对的数量
Count all pairs of dominoes that are equivalent by scanning the array and using a hash table for fast lookup.
第 N 个泰波那契数
Compute the N-th Tribonacci number using state transition dynamic programming with careful memoization and iterative upd…
一年中的第几天
Calculate the day number of the year based on a given Gregorian calendar date in the format YYYY-MM-DD.
拼写单词
Compute the total length of words that can be fully constructed from given characters using array scanning and hash mapp…
质数排列
Calculate the number of valid permutations of 1 to n where prime numbers occupy prime indices using math-driven logic.
公交站间的距离
Compute the minimal distance between two bus stops on a circular route using an array-driven solution approach.
一周中的第几天
Given a date, calculate the corresponding weekday using a math-based strategy, focusing on modular arithmetic.
“气球” 的最大数量
Find the maximum number of times the word 'balloon' can be formed from characters of the given string.
最小绝对差
Find all pairs with the minimum absolute difference between two elements in an array, and return them in ascending order…
独一无二的出现次数
Determine if each integer in an array occurs a unique number of times using efficient hash-based counting and verificati…
玩筹码
Compute the minimum cost to move all chips to one position using parity-based greedy moves efficiently.
分割平衡字符串
Split a string into the maximum number of balanced substrings where each substring has an equal number of 'L' and 'R'.
缀点成线
Determine if a series of coordinates form a straight line on a 2D plane using geometry and mathematical principles.
奇数值单元格的数目
This problem involves updating a matrix based on given indices and counting cells with odd values afterward.
二维网格迁移
Shift 2D Grid requires shifting elements of a matrix by a given number of times, simulating step-by-step movement.
访问所有点的最小时间
Calculate the minimum seconds required to visit all given 2D points in order using optimal diagonal or straight moves.
找出井字棋的获胜者
Determine the winner of a Tic Tac Toe game by scanning moves and using hash lookups for rows, columns, and diagonals eff…
整数的各位积和之差
Calculate the difference between the product and sum of an integer's digits using a simple math-driven approach for effi…
有序数组中出现次数超过25%的元素
Identify the integer occurring more than 25% in a sorted array using a precise array-driven search strategy for efficien…
二进制链表转整数
Convert a binary number represented in a linked list to its decimal value using efficient pointer manipulation.
统计位数为偶数的数字
Count the integers in an array that have an even number of digits using a direct array traversal with digit math.
将每个元素替换为右侧最大元素
Replace every element in an array with the greatest element on its right side, and replace the last element with -1.
和为零的 N 个不同整数
Generate an array of n unique integers that sum to zero using a symmetric pairing strategy to ensure balance.
解码字母到整数映射
Decrypt a string using alphabet-to-integer mapping, considering the presence of '#' as a special delimiter.
解压缩编码列表
Decompress a run-length encoded list by expanding each pair into repeated values based on frequency.
将整数转换为两个无零整数的和
Find two positive integers whose sum equals n and neither contains the digit zero, using a direct math-driven approach.
6 和 9 组成的最大数字
Maximize a number by flipping at most one digit from 6 to 9 or vice versa.
数组序号转换
Transform the elements of an array into their ranks, where the rank represents the size order of the elements.
删除回文子序列
This problem challenges you to remove palindromic subsequences from a string with a minimum number of steps using two-po…
矩阵中战斗力最弱的 K 行
Find the k weakest rows in a binary matrix where rows contain soldiers and civilians, using sorting and binary search te…
将数字变成 0 的操作次数
Reduce a number to zero using bit manipulation and math. Simulate the process step-by-step based on whether the number i…
检查整数及其两倍数是否存在
Solve Check If N and Its Double Exist by scanning once and checking doubles or halves in a hash set.
统计有序矩阵中的负数
Count Negative Numbers in a Sorted Matrix requires counting negative numbers in a matrix sorted in non-increasing order …
根据数字二进制下 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.
日期之间隔几天
Calculate the exact number of days between two dates using string parsing and arithmetic logic with consistent accuracy.
有多少小于当前数字的数字
In this problem, you need to determine how many numbers are smaller than each element in an array, focusing on array sca…
上升下降字符串
Reorder the string based on a specific algorithm using hash tables and string manipulation.
生成每种字符都是奇数个的字符串
Generate a string of n characters where each character appears an odd number of times, using a string-driven approach.
找出克隆二叉树中的相同节点
Find the corresponding node in a cloned binary tree using binary-tree traversal and state tracking.
矩阵中的幸运数
The Lucky Numbers in a Matrix problem involves finding elements that are the minimum in their row and maximum in their c…
两个数组间的距离值
Calculate the distance value between two integer arrays by determining how many elements in arr1 don't have a close coun…
按既定顺序创建目标数组
Learn how to efficiently create a target array by inserting elements at specified indices using array simulation techniq…
找出数组中的幸运数
Identify the largest lucky integer in an array by counting frequencies and comparing values with their occurrences effic…
统计最大组的数目
Count the number of groups with the largest size by summing digits of numbers from 1 to n using a hash table approach.
非递增顺序的最小子序列
Find the minimum subsequence in non-increasing order such that its sum exceeds the sum of non-included elements.
数组中的字符串匹配
Identify all strings in an array that appear as substrings of other strings, focusing on array and string matching patte…
逐步求和得到正数的最小值
Find the minimum starting value to ensure the step-by-step sum of an array is always at least 1.
重新格式化字符串
Reformat The String involves rearranging alphanumeric characters in a string so that no adjacent characters have the sam…
分割字符串的最大得分
Find the optimal split point in a binary string to maximize zeros on the left and ones on the right efficiently.
拥有最多糖果的孩子
Determine which kids, after receiving extra candies, will have the greatest number of candies in a group.
旅行终点站
Find the destination city from a list of paths where each path connects two cities. The city with no outgoing path is th…
是否所有 1 都至少相隔 k 个元素
Check if all 1's in a binary array are at least k places away from each other.
连续字符
Find the power of a string by determining the length of its longest substring with a unique character.
在既定时间做作业的学生人数
Count the number of students doing homework at a given time using an array-driven solution approach.
检查单词是否为句中其他单词的前缀
Determine the first word in a sentence where a given searchWord is a prefix using two-pointer scanning with string match…
通过翻转子数组使两个数组相等
Solve Make Two Arrays Equal by Reversing Subarrays by checking whether target and arr contain the same values with match…
数组中两元素的最大乘积
Find the maximum product of two elements in an array by carefully selecting indices and leveraging sorting for efficienc…
重新排列数组
Shuffle the Array requires an efficient approach to rearrange elements using an array-driven solution strategy with two …
商品折扣后的最终价格
Calculate final prices with discounts applied in a shop using a stack-based state management approach to find the correc…
一维数组的动态和
Calculate the running sum of a given 1D array by updating each element to the sum of itself and all previous elements.
数组异或操作
Compute the bitwise XOR of a dynamically generated array using a combination of math and bit manipulation techniques eff…
去掉最低工资和最高工资后的工资平均值
Calculate the average salary of employees, excluding the highest and lowest salaries, from an array of unique salaries.
判断路径是否相交
Check if a path crosses itself on a 2D plane using a hash table to track visited points during traversal.
判断能否形成等差数列
Determine if a given array can be rearranged into a valid arithmetic progression using sorting and consecutive differenc…
转变日期格式
Reformat Date requires transforming a date string from human-readable form to YYYY-MM-DD using a string-driven strategy …
好数对的数目
Count all index pairs in an array where elements match and the first index is smaller, using hash-based scanning efficie…
换水问题
Maximize the number of water bottles you can drink by simulating the exchange process between full and empty bottles.
在区间范围内统计奇数数目
Count Odd Numbers in an Interval Range efficiently using a math-driven formula that avoids unnecessary iteration over la…
重新排列字符串
Reorder characters in a string using a given indices array to reconstruct the intended output efficiently and correctly.
统计好三元组
Count Good Triplets requires identifying all triplets in an array that satisfy multiple absolute difference constraints …
第 k 个缺失的正整数
Find the kth missing positive integer in a strictly increasing array using binary search over the answer space efficient…
整理字符串
This problem requires removing adjacent characters that cancel each other out, leveraging stack-based state management.
存在连续三个奇数的数组
Determine if an integer array contains three consecutive odd numbers using a direct array-driven solution strategy for f…
千位分隔数
Convert a given integer into a string with dots as thousand separators using a precise string-driven strategy.
圆形赛道上经过次数最多的扇区
Determine which sectors on a circular track are visited most frequently using array and simulation techniques efficientl…
重复至少 K 次且长度为 M 的模式
Determine if a subarray of length m repeats k or more consecutive times in a given integer array efficiently.
矩阵对角线元素的和
Calculate the sum of both primary and secondary diagonals in a square matrix while avoiding double-counting overlaps.
替换所有的问号
Solve LeetCode 1576 by scanning left to right and replacing each ? with a letter different from its neighbors.
二进制矩阵中的特殊位置
Identify all special positions in a binary matrix where a 1 has no other 1s in its row or column, ensuring optimal array…
所有奇数长度子数组的和
Calculate the sum of all odd-length subarrays in a given integer array using efficient array and math strategies.
重新排列单词间的空格
Rearrange spaces between words by distributing them evenly, placing any leftover spaces at the end to match original tex…
文件夹操作日志搜集器
Simulate folder navigation based on a list of operations to determine the current folder depth.
设计停车系统
Implement a class to manage a parking lot with fixed slots for big, medium, and small cars, tracking occupancy efficient…
特殊数组的特征值
Determine if an array has exactly x elements greater than or equal to x using binary search over the answer space.
括号的最大嵌套深度
Find the maximum nesting depth of parentheses in a valid string using stack-based state management.
删除某些元素后的数组均值
Calculate the trimmed mean by removing the lowest and highest 5% of elements in an array using sorting for accuracy and …
两个相同字符之间的最长子字符串
Find the longest substring between two equal characters using a hash table for optimized performance.
按键持续时间最长的键
Determine which key had the longest press duration in a sequence using array indices and string mapping, resolving ties …
按照频率将数组升序排序
Sort Array by Increasing Frequency requires counting each element and ordering them by frequency, breaking ties with des…
两点之间不包含任何点的最宽垂直区域
Find the maximum width of a vertical area between points with no points inside using array sorting efficiently.
能否连接形成数组
Determine if an array can be formed by concatenating subarrays without reordering individual elements, using hash lookup…
获取生成数组中的最大值
Compute the maximum value in a generated array using defined recurrence rules, leveraging array simulation techniques ef…
拆炸弹
Defuse the Bomb uses a sliding window to update a circular array based on a key, with efficient state updates.
设计有序流
Design an Ordered Stream that returns values in increasing order based on unique integer IDs with efficient insertion an…
检查两个字符串数组是否相等
Determine if two string arrays form identical strings by concatenating elements in order, handling subtle array-length m…
最大重复子字符串
Find the maximum number of times a given word repeats consecutively in a string using state transition dynamic programmi…
最富有客户的资产总量
Calculate the richest customer's wealth by summing the amounts in each customer's bank accounts in a matrix.
设计 Goal 解析器
Interpret the Goal Parser's output by analyzing a command string containing 'G', '()', and '(al)' patterns.
统计一致字符串的数目
Count the number of strings fully composed of allowed characters using array scanning and hash lookup for efficiency.
比赛中的配对次数
Calculate the total matches in a tournament by simulating rounds and applying simple math rules for advancing teams.
重新格式化电话号码
Reformat a phone number by removing spaces and dashes, grouping digits into blocks of 3 or 2, and joining them with dash…
无法吃午餐的学生数量
Simulate a queue of students with sandwich preferences and determine how many can't eat based on available sandwiches.
判断字符串的两半是否相似
Check if two halves of a string contain the same number of vowels using a character counting approach efficiently.
卡车上的最大单元数
Maximize total units loaded on a truck by choosing boxes greedily based on highest units per box within truck capacity l…
计算力扣银行的钱
Calculate the total amount of money in the Leetcode bank at the end of the nth day, based on a weekly increasing deposit…
解码异或后的数组
Recover the original integer array from its XOR-encoded version using direct bitwise manipulation and sequential reconst…
可以形成最大正方形的矩形数目
Determine how many rectangles can be trimmed to form the largest possible square using an array-driven solution strategy…
找到最高海拔
Find the highest altitude after a series of altitude changes during a road trip using prefix sum technique.
替换隐藏数字得到的最晚时间
Determine the latest valid time by replacing hidden digits using a greedy choice and invariant validation strategy effic…
盒子中小球的最大数量
The problem asks you to find the box with the maximum number of balls based on the sum of digits of ball numbers.
唯一元素的和
Given an array, find the sum of all its unique elements by identifying those that appear only once.
检查数组是否经排序和轮转得到
Determine if a given integer array is sorted in non-decreasing order and then rotated, handling duplicates correctly.
生成交替二进制字符串的最少操作数
Find the minimum number of changes required to convert a string into an alternating binary string.
最长的美好子字符串
Find the longest nice substring in a given string using the sliding window technique with running state updates.
交替合并字符串
Merge two strings alternately, starting with the first string, and append extra characters when one string is longer.
统计匹配检索规则的物品数量
Count Items Matching a Rule is an easy problem that tests array and string manipulation with conditions based on specifi…
找到最近的有相同 X 或 Y 坐标的点
Find the nearest point with the same x or y coordinate using Manhattan distance. Return its index or -1 if none exists.
检查二进制字符串字段
Check if a binary string contains at most one contiguous segment of ones.
仅执行一次字符串交换能否使两个字符串相等
Check if one string swap can make two equal strings using hash table and string counting methods.
找出星型图的中心节点
Find the center node of a star graph, where one node connects to all others.
字符串中第二大的数字
Given a string with alphanumeric characters, find the second largest digit, or return -1 if it doesn’t exist.
最大升序子数组和
Solve Maximum Ascending Subarray Sum by scanning once, extending rising runs, and resetting the running sum at each drop…
字符串中不同整数的数目
Count all unique integers in a string by replacing letters and handling leading zeros correctly with a hash table approa…
判断国际象棋棋盘中一个格子的颜色
Determine whether a given chessboard square is white or black by converting coordinates using a math plus string approac…
截断句子
Truncate a sentence to contain only the first k words by converting it into an array of words.
数组元素积的符号
Determine the sign of a product from an integer array using a single pass without computing the full product.
最少操作使数组递增
Calculate the minimum number of increments required to transform a given integer array into a strictly increasing sequen…
判断句子是否为全字母句
Determine if a given lowercase string contains every English letter using efficient hash table tracking techniques.
K 进制表示下的各位数字总和
Calculate the sum of digits of a number after converting it from base 10 to any given base using a math-driven approach.
将所有数字用字符替换
Transform a string by replacing digits at odd indices using the preceding character with a shift operation for accurate …
到目标元素的最小距离
Solve Minimum Distance to the Target Element by scanning the array and tracking the smallest distance from start.
人口最多的年份
Find the earliest year with the highest population using an array plus counting approach.
将句子排序
Reconstruct a shuffled sentence by sorting words using their embedded indices to restore the original sentence order eff…
找出所有子集的异或总和再求和
Compute the sum of all subset XOR totals using a backtracking search with pruning for arrays of small size.
哪种连续子字符串更长
Determine if the longest segment of 1s in a binary string is strictly longer than the longest segment of 0s.
长度为三且各字符不同的子字符串
Count all substrings of length three in a string where each character is unique using sliding window techniques efficien…
检查某单词是否等于两单词之和
Check if the sum of two word values equals a target word's value by converting letters to their numeric representations.
判断矩阵经轮转后是否一致
Determine if a binary matrix can be transformed into another by rotating it 90 degrees multiple times.
检查是否区域内所有整数都被覆盖
Check if all integers in the range [left, right] are covered by intervals in a given set of ranges.
重新分配字符使所有字符串都相等
Determine if you can redistribute characters among strings so that all strings become identical using a counting approac…
字符串中的最大奇数
Find the largest odd number in a string using a greedy approach with careful digit inspection and invariant checks.
删除一个元素使数组严格递增
Determine if removing a single element from an array can make it strictly increasing, using a careful index check approa…
两个数对之间的最大乘积差
Find the maximum product difference between two pairs in an integer array using sorting for optimal selection.
基于排列构建数组
The problem asks to build an array from a given permutation using an efficient approach.
统计平方和三元组的数目
Count Square Sum Triples asks to find the number of integer triples where a² + b² = c² for values between 1 and n.
数组串联
This problem asks you to create an array of double the size, where each element is repeated twice in sequence.
可以输入的最大单词数
Determine how many words can be typed on a malfunctioning keyboard with some broken keys.
检查是否所有字符出现次数相同
Check if a string has characters with equal occurrences using hash tables and string manipulation techniques.
字符串转化后的各位数字之和
Convert a lowercase string into digits and repeatedly sum them k times using a direct string plus simulation approach.
三除数
Determine if a given integer has exactly three positive divisors.
删除字符使字符串变好
This problem asks to remove the minimum number of characters from a string to ensure no three consecutive characters are…
检查字符串是否为数组前缀
Determine if a string is a prefix of an array by concatenating initial elements, using two-pointer scanning efficiently.
作为子字符串出现在单词中的字符串数目
Count how many strings in an array appear as substrings within a given word by checking each pattern individually.
寻找图中是否存在路径
Determine if a valid path exists between two vertices in a bi-directional graph using traversal techniques.
使用特殊打字机键入单词的最少时间
Compute the minimum typing time by greedily taking the shorter circular move between consecutive letters, then adding on…
找出数组的最大公约数
Find the greatest common divisor of the smallest and largest numbers in an integer array.
学生分数的最小差值
Minimize the difference between the highest and lowest of k student scores using a sliding window approach.
找到数组的中间位置
Find the smallest middle index where the sum of elements on the left equals the sum on the right using prefix sums effic…
统计特殊四元组
Count Special Quadruplets requires scanning arrays and using hash lookups to efficiently find quadruplets matching sum c…
反转单词前缀
Reverse the prefix of a string starting from index 0 to the first occurrence of a given character.
差的绝对值为 K 的数对数目
Find how many pairs (i, j) with i < j satisfy |nums[i] - nums[j]| == k using array scanning and hash lookup.
执行操作后的变量值
Compute the final value of X by simulating each string operation in the array sequentially with careful tracking.
增量元素之间的最大差值
Find the maximum difference between two increasing elements in an array using a linear scan to track the minimum value e…
将一维数组转变成二维数组
Convert a 1D integer array into a structured 2D array with specified rows and columns using all elements sequentially.
转换字符串的最少操作次数
Minimize moves to convert a string of 'X' and 'O' to all 'O' by converting three consecutive characters to 'O'.
至少在两个数组中出现的值
Identify all elements appearing in at least two of three arrays using efficient scanning and hash lookups for fast verif…
使每位学生都有座位的最少移动次数
Calculate the minimum total moves to seat each student using greedy assignment and invariant validation efficiently.
检查句子中的数字是否递增
Check if the numbers in a sentence are strictly increasing from left to right using string tokenization.
句子中的有效单词数
Count all valid words in a sentence by analyzing each token with precise string-driven validation rules efficiently.
数组中第 K 个独一无二的字符串
Find the kth distinct string in an array by identifying strings that appear only once, using efficient array scanning an…
值相等的最小索引
Find the smallest index where the index mod 10 equals the value at that index in the given array.
统计字符串中的元音子字符串
Count the number of vowel substrings that include all five vowels in a string.
检查两个字符串是否几乎相等
Solve Check Whether Two Strings are Almost Equivalent by counting letters and rejecting any character whose frequency ga…
买票需要的时间
Calculate the total time for a specific person to buy all their tickets using queue-driven state processing.
两栋颜色不同且距离最远的房子
Maximize the distance between two houses with different colors by using a greedy approach and validating the choice.
统计出现过一次的公共字符串
Learn how to efficiently count strings appearing exactly once in both arrays using array scanning and hash lookup patter…
找出数组排序后的目标下标
Find the target indices of a sorted array and return them in increasing order using binary search and sorting techniques…
找出 3 位偶数
Generate unique 3-digit even numbers from a given array of digits with duplicates.
找到和最大的长度为 K 的子序列
Pick the k largest values, then restore their original order to build the maximum-sum subsequence correctly.
环和杆
Count how many rods have all three colors using a hash table to track colors per rod efficiently in strings.
找出数组中的第一个回文字符串
Return the first palindromic string from an array of words or an empty string if none exists.
句子中的最多单词数
Find the maximum number of words in a single sentence from an array of sentences using array and string processing techn…
反转两次的数字
Determine if reversing a number twice returns the original integer by analyzing trailing zeros and digit placement.
检查是否所有 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…
将标题首字母大写
Capitalize the Title requires transforming each word based on length, applying uppercase and lowercase rules precisely p…
检查是否每一行每一列都包含全部整数
Determine if every row and column in a square matrix contains all numbers from 1 to n without repetition using array sca…
将字符串拆分为若干长度为 k 的组
Divide a string into equal groups of size k, using a fill character to complete the last group if needed.
打折购买糖果的最小开销
Minimize the total cost of buying candies using a greedy approach with a discount system based on candy prices.
元素计数
Count elements in an array that have both strictly smaller and strictly greater numbers using array sorting efficiently.
将找到的值乘以 2
The "Keep Multiplying Found Values by Two" problem involves repeatedly multiplying a number by two if it is found in an …
拆分数位后四位数字的最小和
Find the minimum sum of two 2-digit numbers by splitting a four-digit number into two integers.
对奇偶下标分别排序
Rearrange a 0-indexed array by sorting even and odd indices independently for predictable order and correctness.
得到 0 的操作数
Simulate operations on two integers until one becomes zero, counting how many steps it takes to achieve the result.
统计数组中相等且可以被整除的数对
Given an array, count pairs of elements that are equal and their indices product is divisible by a given integer.
统计各位数字之和为偶数的整数个数
Solve this Easy Math plus Simulation problem by counting numbers whose digit sums are even up to a given limit efficient…
统计包含给定前缀的字符串
Count how many words in a list start with a given prefix.
数组中紧跟 key 之后出现最频繁的数字
Scan the array once, count which value appears right after the key, and return the uniquely most frequent follower.
Excel 表中某个范围内的单元格
This problem requires extracting a range of cells from an Excel-like sheet based on a string input and returning them in…
找出数组中的所有 K 近邻下标
Identify all indices in an array that are within k distance of elements equal to the given key using two-pointer scannin…
将数组划分成相等数对
Determine if an array of 2n integers can be partitioned into n pairs where each pair contains identical elements using h…
统计数组中峰和谷的数量
Count Hills and Valleys in an Array determines the number of hills and valleys in a given array by analyzing index neigh…
找出两数组的不同
Find the Difference of Two Arrays helps you identify unique elements between two integer arrays using array scanning and…
转换数字的最少位翻转次数
Determine the minimum number of bit flips required to convert one integer to another using precise bit manipulation.
转化时间需要的最少操作数
The problem asks to find the minimum number of operations to convert one time string to another using specific time incr…
按奇偶性交换后的最大数字
Maximize a number by swapping digits of the same parity using sorting and priority queue techniques efficiently.
两整数相加
This problem asks to return the sum of two integers within a specific range, focusing on math-driven solution strategy.
判断根结点是否等于子结点之和
Check if a binary tree root value equals the sum of its immediate left and right child nodes efficiently.
找到最接近 0 的数字
Identify the number in an integer array that is closest to zero, returning the larger one if tied.
计算字符串的数字和
Learn how to repeatedly sum digit groups in a string until its length is at most k using string simulation techniques.
多个数组求交集
Find integers that are common across all arrays in a given list of arrays.
统计是给定字符串前缀的字符串数目
Count Prefixes of a Given String is a problem that involves finding the number of string prefixes in an array that match…
移除指定数字得到的最大结果
Determine the largest possible number by removing one specific digit using a greedy approach and string iteration.
字符串中最大的 3 位相同数字
Find the largest 3-same-digit number within a string of digits using a string-driven solution approach.
找到一个数字的 K 美丽值
Calculate the k-beauty of a number by counting substrings of length k that divide the original number evenly using a sli…
移除字母异位词后的结果数组
This problem requires removing adjacent anagrams from a list of words using an array scanning and hash lookup approach.
字母在字符串中的百分比
Calculate the percentage of a specific letter in a string using a direct string-driven counting approach, rounding down …
判断一个数的数字计数是否等于数位的值
Determine if a number's digits correspond to their counts in the string representation.
重排字符形成目标字符串
Calculate the maximum copies of a target string from letters in s using frequency counting and hash tables efficiently.
极大极小游戏
The Min Max Game problem requires simulating an array reduction process to find the last remaining number.
强密码检验器 II
Check if a given password meets all strength requirements, including length, character types, and no adjacent repeated c…
计算应缴税款总额
Calculate the total tax owed by iterating through sorted brackets and applying each rate incrementally to your income.
兼具大小写的最好英文字母
Find the greatest English letter that exists in both lowercase and uppercase in a string using a hash table approach.
统计星号
The 'Count Asterisks' problem asks you to count '*' excluding those between pairs of '|' in a string.
判断矩阵是否是一个 X 矩阵
Check if a square matrix follows the X-Matrix pattern by validating diagonal and non-diagonal conditions.
解密消息
Decode the Message is an easy problem involving hash table mapping for string decoding based on a cipher key.
计算布尔二叉树的值
Determine the boolean outcome of a full binary tree by evaluating leaf and internal nodes using depth-first traversal.
装满杯子需要的最短总时长
Determine the minimum seconds to fill cups of cold, warm, and hot water using a greedy selection strategy and invariant …
数组能形成多少数对
Given an array, count how many pairs can be formed and how many leftovers remain after pairing.
最好的扑克手牌
Determine the strongest poker hand from five cards using array scanning and hash table counting techniques efficiently.
第一个出现两次的字母
Find the first letter that repeats in a string using hash table tracking and early detection for efficiency.
使数组中所有元素都等于零
Minimize operations to make all array elements zero by subtracting equal amounts in each operation.
合并相似的物品
Merge Similar Items combines values and weights from two lists, returning the result sorted by value.
等差三元组的数目
Count the number of arithmetic triplets in a given strictly increasing array with a specified difference.
矩阵中的局部最大值
Find the largest value in every 3x3 submatrix of an n x n integer matrix efficiently using nested loops.
得到 K 个黑块的最少涂色次数
Given a string of blocks, determine the minimum number of recolors needed to get k consecutive black blocks.
赢得比赛需要的最少训练时长
Find the minimum hours of training needed to beat all opponents in a competition based on energy and experience.
和有限的最长子序列
Find the maximum size of a subsequence from nums with a sum less than or equal to each query value.
和相等的子数组
Find Subarrays With Equal Sum is solved by scanning adjacent pairs and storing each length-2 sum in a hash set.
检查相同字母间的距离
Verify if each pair of identical letters in a string has the exact number of letters between them as specified in a dist…
出现最频繁的偶数元素
Identify the most frequent even element in an array using counting and hash lookup, handling ties by choosing the smalle…
统计共同度过的日子数
Count the total number of days Alice and Bob are in Rome together, given their arrival and departure dates.
最小偶倍数
Find the smallest even multiple of a given integer using math and number theory concepts efficiently.
按身高排序
Sort the People requires pairing names with heights and sorting them in descending height order efficiently using arrays…
删除字符使频率相同
Determine if removing a single letter from a string can make all remaining letters have identical frequency efficiently.
公因子的数目
The problem asks to find the number of common factors of two positive integers a and b.
处理用时最长的那个任务的员工
Identify which employee spent the longest time on a task using an array-driven approach, analyzing each log entry effici…
有效时间的数目
Calculate how many valid digital clock times can be formed by replacing unknown digits in a string format hh:mm.
与对应负数同时存在的最大正整数
Find the largest positive integer in an array such that its negative counterpart also exists.
判断两个事件是否存在冲突
Compare two same-day time intervals and check whether their inclusive endpoints overlap after converting HH:MM strings i…
差值数组不同的字符串
Identify the one string in an array whose consecutive letter differences deviate from all others using array scanning pl…
可被三整除的偶数的平均值
Find the average of even numbers divisible by 3 from an array of positive integers.
对数组执行操作
Transform an array by applying adjacent doubling operations and shifting zeros efficiently using two-pointer scanning te…
不同的平均值数目
Calculate the number of unique averages formed by repeatedly pairing smallest and largest elements efficiently using has…
温度转换
Convert the given Celsius temperature to Kelvin and Fahrenheit using mathematical formulas and return the result in an a…
数组中不等三元组的数目
Count all triplets in a positive integer array where each element is distinct using scanning and hash lookup efficiently…
分割圆的最少切割次数
Calculate the fewest cuts required to divide a circle into n equal slices using math and geometric reasoning efficiently…
找出中枢整数
Find the Pivot Integer problem challenges you to identify an integer x that balances prefix sums on both sides.
回环句
Determine if a sentence is circular by verifying each word's last character matches the next word's first character effi…
数组中字符串的最大值
The problem requires finding the maximum value of alphanumeric strings in an array based on length or numeric value.
删除每行中的最大值
Calculate the total of removed maximum values from each row of a matrix, iterating until all columns are deleted efficie…
统计相似字符串对的数目
Count similar string pairs by converting each word into a character-set signature and counting matching signatures effic…
最多可以摧毁的敌人城堡数目
Find the maximum number of enemy forts that can be captured by moving your army using two-pointer scanning with invarian…
到目标字符串的最短距离
Find the shortest distance to a target string in a circular array with either left or right movement options.
统计能整除数字的位数
Count the digits that divide a number by checking each digit's divisibility.
根据规则将箱子分类
Classify a box as "Heavy", "Bulky", or "Neither" based on its dimensions and mass using math-driven strategies.
正整数和负整数的最大计数
Compute the maximum count between positive and negative integers in a sorted array using efficient binary search countin…
数组元素和与数字和的绝对差
Find the absolute difference between element sum and digit sum of an array of integers.
最小公共值
Find the smallest integer appearing in both sorted arrays efficiently using array scanning and hash-based lookup techniq…
交替数字和
Compute the alternating digit sum by applying a sign to each digit and summing efficiently using a math-driven approach.
统计桌面上的不同数字
Compute the number of distinct integers generated on a board using repeated modulo operations over a long sequence of da…
分割数组中数字的数位
Given an array of positive integers, separate each integer into its individual digits while preserving the original orde…
从数量最多的堆取走礼物
Take Gifts From the Richest Pile uses a heap to simulate the process of taking gifts from the richest pile over a number…
找出数组的串联值
Compute the array concatenation value efficiently using two-pointer scanning while maintaining a running total of concat…
替换一个数字后的最大差值
Find the largest difference by remapping a single digit in a number using a greedy approach to maximize and minimize out…
合并两个二维数组 - 求和法
Merge two 2D arrays by summing values with matching ids using array scanning and hash lookup efficiently.
左右元素和的差值
Compute absolute differences between left and right cumulative sums for each element in an integer array efficiently.
最小和分割
Split a positive integer into two parts to minimize their sum using a greedy approach and sorting.
递枕头
Pass the Pillow simulates the process of passing an item through a line of people, adjusting the direction based on time…
统计范围内的元音字符串数
Count the Number of Vowel Strings in Range asks to count vowel strings in a subarray of a given word list.
将钱分给最多的儿童
Determine the maximum number of children who can each receive exactly 8 dollars using a greedy approach with validation …
奇偶位数
Count the number of 1s at even and odd indices in the binary representation of a given integer n.
K 件物品的最大和
Select k items from a bag containing 1, 0, and -1 to maximize sum using greedy choice and invariant validation strategie…
从两个数字数组里生成最小数字
Given two arrays of digits, find the smallest possible number formed by one digit from each array.
最长平衡子字符串
Find the longest balanced substring of a binary string where zeroes precede ones and counts of each are equal.
对角线上的质数
Find the largest prime number located on any diagonal of a square matrix using array iteration and prime checking techni…
数组原型对象的最后一个元素
Implement a method on all arrays that returns the last element or -1 for empty arrays, using Array.prototype correctly.
计数器
Implement a counter function that returns increasing integers starting from a given initial value with each call, levera…
睡眠函数
Create an asynchronous function that sleeps for a given number of milliseconds and resolves any value.
数组归约运算
Implement the Array Reduce Transformation pattern by applying a reducer function on an array with a given initial value.
复合函数
Learn how to implement function composition by combining multiple functions into a single callable operation efficiently…
过滤数组中的元素
Filter elements from an array based on a custom function using core interview patterns.
转换数组中的每个元素
Transform each element in an array based on a given function without using the built-in Array.map method.
查询网格图中每一列的宽度
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…
一最多的行
Find the row with the maximum ones in a binary matrix and return its index and count.
找出可整除性得分最大的整数
Determine the divisor with the highest count of divisible elements in an array using a clear array-driven strategy.
生成斐波那契数列
Implement a generator that produces the Fibonacci sequence up to a specified number of elements efficiently in JavaScrip…
计算列车到站时间
Calculate the new arrival time of a delayed train in 24-hour format by using basic math operations.
倍数求和
Find the sum of integers divisible by 3, 5, or 7 in the range [1, n].
K 个元素的最大和
Maximize your score by performing exactly k operations on an array using a greedy approach to select the highest values.
保龄球游戏的获胜者
Simulate a bowling game to determine the winner based on hit pins per turn for two players.
计数器 II
Implement a counter with functions to increment, decrement, and reset it based on an initial value.
只允许一次函数调用
Learn how to wrap a function so it executes at most once, capturing results while ignoring extra calls efficiently.
创建 Hello World 函数
The Create Hello World Function problem tests a candidate's ability to return a constant value from a function regardles…
找出不同元素数目差数组
Calculate the distinct difference array of a given list of integers by counting distinct elements in the prefix and suff…
分块数组
Chunk Array splits a given array into smaller subarrays of specified size, preserving original element order and handlin…
老人的数目
Determine how many passengers are over 60 years old based on their compressed details in an array of strings.
找出转圈游戏输家
Simulate a ball-passing game around a circle using array scanning and hash lookup to find friends who never receive the …
包装数组
The Array Wrapper problem focuses on implementing a class that wraps an array to perform operations like addition or str…
删除子串后的字符串最小长度
Determine the smallest string length after repeatedly removing AB or CD substrings using stack-based simulation techniqu…
字典序最小回文串
Given a string, make it a palindrome with the fewest operations, prioritizing lexicographically smallest result.
返回传递的参数的长度
Determine the number of arguments passed to a function, practicing direct counting of parameters in real-time function c…
相等还是不相等
Implement a function 'expect' to help developers test values using 'toBe' and 'notToBe' methods.
购买两块巧克力
Determine the leftover money after buying exactly two chocolates using a greedy selection and sum validation approach.
移除字符串中的尾随零
Remove trailing zeros from a string representing a positive integer number.
执行可取消的延迟函数
Learn to implement timeout cancellation logic for function execution using a custom cancel function.
最小化字符串长度
Minimize String Length asks you to reduce a string by removing duplicates using a Hash Table strategy efficiently.
半有序排列
Find the minimum number of operations to convert a permutation into a semi-ordered permutation where 1 is first and n is…
两个 Promise 对象相加
The problem 'Add Two Promises' involves adding the resolved values of two promises and returning the result.
排序方式
Sort By requires sorting an array using a custom function, producing ascending order based on function outputs efficient…
间隔取消
Implement a cancellable function with repeated executions at fixed intervals before a cancellation time.
使用方法链的计算器
Design a Calculator class that supports method chaining for mathematical operations like addition, subtraction, multipli…
判断对象是否为空
Determine if a given object or array is empty by checking its keys or length efficiently in interviews.
判断一个数是否迷人
Determine if a 3-digit number is fascinating by checking if the concatenated result of n, 2*n, and 3*n contains all digi…
既不是最小值也不是最大值
Find a number in an array that is neither the minimum nor maximum value, or return -1 if no such number exists.
总行驶距离
Calculate the maximum distance a truck can travel using main and additional fuel tanks with controlled transfers.
最大字符串配对数目
Find the maximum number of pairs of distinct strings from an array where one string is the reverse of the other.
美丽下标对的数目
Count all index pairs in an array where the first digit of one number and last digit of another are coprime efficiently.
最长奇偶子数组
Determine the length of the longest subarray where elements alternate even and odd while staying below a given threshold…
最长交替子数组
Find the longest alternating subarray in a given array of integers.
找出最大的可达成数字
Determine the largest number achievable by repeatedly applying a simple math operation up to t times efficiently.
特殊元素平方和
Calculate the sum of squares of special elements in a 1-indexed array using index divisibility checks efficiently.
检查数组是否是好的
Determine if a given integer array is a permutation of base[n], containing 1 to n-1 once and n twice, using scanning and…
按分隔符拆分字符串
Split Strings by Separator requires iterating through an array of strings and splitting each by a given separator charac…
满足目标工作时长的员工数目
Determine how many employees reach the required work hours using a direct array-driven counting approach.
取整购买后的账户余额
Given a purchase amount, calculate the account balance after rounding the purchase to the nearest multiple of 10 and ded…
故障键盘
Simulate typing on a faulty keyboard where pressing 'i' reverses the string, requiring careful string manipulation track…
数组中的最大数对和
Find the maximum sum of two numbers in an array sharing the same largest digit using a hash-based scan efficiently.
统计和小于目标的下标对数目
This problem asks you to count all index pairs in an array whose sum is strictly less than a given target value efficien…
判别首字母缩略词
Check if a string can be formed by concatenating the first letters of each word in a given list.
距离原点最远的点
Determine the maximum distance from origin using string moves and counting underscores optimally for efficient calculati…
判断通过操作能否让字符串相等 I
Determine if two strings can be made equal by repeatedly swapping characters at any two indices in each string.
统计对称整数的数目
Count Symmetric Integers finds numbers where the sum of the first half of digits equals the sum of the second half withi…
与车相交的点
Count covered integer points by merging overlapping car intervals or marking visited positions on the number line.
使数组成为递增数组的最少右移次数
Determine the minimum number of right shifts to sort a distinct integer array or return -1 if impossible using array ana…
计算 K 置位下标对应元素的和
Sum values in an array where the indices have exactly k set bits in binary representation.
最大二进制奇数
Rearrange a binary string to form the largest odd binary number using a greedy approach and least significant bit valida…
收集元素的最少操作次数
Scan from the end, track seen values from 1 to k, and stop once every required number is collected.
有序三元组中的最大值 I
Find the maximum value of a triplet in an array where indices follow the order i < j < k.
从表中创建 DataFrame
Solve the problem of creating a DataFrame from a list of student data by using the pandas library.
获取 DataFrame 的大小
Learn how to efficiently calculate the number of rows and columns in a DataFrame using Python pandas for interview succe…
显示前三行
Solve a problem where you need to display the first three rows of a DataFrame in Python.
数据选取
Learn to efficiently select specific rows and columns in a dataset using the Select Data core interview pattern for accu…
创建新列
Create a New Column is a simple problem involving DataFrame manipulation, requiring the creation of a new column based o…
删去重复的行
This problem requires removing duplicate rows based on the email column and retaining only the first occurrence.
删去丢失的数据
Remove rows with missing values from a dataset, focusing on the drop missing data pattern.
修改列
Learn how to efficiently modify a DataFrame column by applying a transformation to every value in a single pass.
重命名列
This problem asks you to rename columns in a DataFrame to match a specified format using a built-in function.
改变数据类型
Correct column data types in a DataFrame, focusing on converting float columns to integers efficiently and accurately.
填充缺失值
Fill Missing Data is an easy-level problem that focuses on handling missing values in a dataset.
重塑数据:连结
Concatenate two DataFrames vertically by stacking rows to produce a single combined DataFrame efficiently using pandas.
数据重塑:透视
Learn how to pivot data in a table so each row is a month and each city forms its own column efficiently.
重塑数据:融合
Reshape the data so that each row represents sales data for a product across different quarters.
方法链
In Method Chaining, solve problems using sequential method calls with clean, readable code. Apply this to filter and sor…
分类求和并作差
Compute the difference between sums of integers divisible and non-divisible by m using a direct arithmetic approach effi…
上一个遍历的整数
This problem involves finding the last visited integer for each -1 in a given array by simulating a stack-like behavior.
最长相邻不相等子序列 I
Find the longest alternating subsequence in a string array based on a binary group array.
找出满足差值条件的下标 I
Find two indices in an array where their difference in both index and value meets specified thresholds.
元素和最小的山形三元组 I
Find the minimum sum of a mountain triplet in an array of integers, or return -1 if no valid triplet exists.
子数组不同元素数目的平方和 I
Compute the sum of squares of distinct elements for all subarrays using array scanning with hash lookups efficiently.
找出数组中的 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.
找到冠军 I
Find Champion I is an easy problem focusing on identifying the strongest team in a tournament using matrix-based compari…
给小朋友们分糖果 I
Given two integers n and limit, find the number of ways to distribute n candies among 3 children, with no child receivin…
找出强数对的最大异或值 I
Find the maximum XOR of any strong pair in an integer array using array scanning and hash-based lookups efficiently.
使三个字符串相等
Determine the minimum number of operations to make three strings equal by removing rightmost characters from one string …
查找包含给定字符的单词
Identify all indices of words containing a specific character using array and string traversal techniques efficiently.
循环移位后的矩阵相似检查
Determine if a matrix returns to its original state after performing cyclic row shifts k times using array and math patt…
找出峰值
Identify all peaks in a mountain array using direct array enumeration and strict neighbor comparisons efficiently.
找到两个数组中的公共元素
Quickly find all numbers that appear in both arrays using scanning and hash lookup to handle duplicates efficiently.
统计已测试设备
Simulate testing devices based on battery percentages to determine how many pass the test operations in sequence.
找出缺失和重复的数字
Find the missing and repeated numbers in an n x n grid using array scanning and hash lookup.
统计移除递增子数组的数目 I
Count the number of incremovable subarrays in an array by removing them to create a strictly increasing sequence.
最小数字游戏
The Minimum Number Game involves simulating moves by Alice and Bob on an array, sorting elements and appending them to a…
检查按位或是否存在尾随零
Check if a bitwise OR of two or more numbers has trailing zeros in its binary representation.
大于等于顺序前缀和的最小缺失整数
Find the smallest missing integer greater than the sum of the longest sequential prefix in an array.
对角线最长的矩形的面积
Find the rectangle with the longest diagonal in a 2D array and return its area, prioritizing maximum area on ties.
最大频率元素计数
Count Elements With Maximum Frequency is solved by counting each value, tracking the highest count, and summing matching…
将数组分成最小总代价的子数组 I
Divide an array into three contiguous subarrays with minimum cost by leveraging array and sorting principles.
输入单词需要的最少按键次数 I
Calculate the minimum pushes to type a word using a remapped telephone keypad with greedy allocation of letters.
按键变更的次数
Count how many times a user switches keys in a typed string, ignoring shift and caps lock variations in characters.
三角形类型
Determine the type of triangle from a three-element array using side sums and equality checks efficiently in constant ti…
边界上的蚂蚁
Solve the problem of counting how often an ant returns to a boundary based on the steps described in the input array.
修改矩阵
Modify the Matrix efficiently by replacing all -1 elements with the maximum in their column using array and matrix opera…
相同分数的最大操作数目 I
Determine the maximum number of operations in an integer array where each operation must produce the same score.
统计前后缀下标对 I
Count all index pairs where one word is both a prefix and suffix of another, using efficient array and string checks.
分割数组
Determine if an even-length array can be split into two parts with all distinct elements using hash lookup scanning.
超过阈值的最少操作数 I
Count how many numbers are below k, because each such value must be removed in Minimum Operations to Exceed Threshold Va…
将元素分配到两个数组中 I
Distribute elements from a distinct integer array into two subarrays using a sequential simulation strategy for optimal …
重新分装苹果
Distribute packs of apples into boxes using a greedy strategy, minimizing the number of boxes selected efficiently and c…
求出加密整数的和
Compute the sum of encrypted integers by replacing each digit with the largest digit, combining array traversal with dig…
字符串及其反转中是否存在同一子字符串
Check for any substring of length 2 in a string and its reverse using a hash table and string comparison.
每个字符最多出现两次的最长子字符串
Find the maximum length substring where some substring occurs at least twice using a sliding window and hash mapping str…
或值至少 K 的最短子数组 I
Find the shortest non-empty subarray in nums whose bitwise OR reaches at least k using sliding window efficiently.
哈沙德数
Given an integer, determine if it is a Harshad number by checking if it's divisible by the sum of its digits.
最长的严格递增或递减子数组
Find the longest subarray in a given array that is either strictly increasing or strictly decreasing.
字符串的分数
Calculate the sum of absolute ASCII differences between adjacent characters to score any given string efficiently.
替换字符可以得到的最晚时间
Given a time string with "?" characters, replace them to form the latest valid 12-hour time.
统计特殊字母的数量 I
Count the number of special characters in a given string using hash tables and string manipulation.
构造相同颜色的正方形
Determine if a 3x3 grid can form a 2x2 square of the same color by changing at most one cell efficiently.
找出与数组相加的整数 I
Find the integer added to nums1 to make it equal to nums2 using an array-driven strategy.
有效单词
Determine if a given string qualifies as a valid word using a string-driven solution pattern with explicit character rul…
判断矩阵是否满足条件
Check if a grid satisfies given conditions by analyzing array and matrix structure with specific checks on values.
两个字符串的排列差
Compute the total index difference between two strings by mapping characters and summing their positional distances effi…
特殊数组 I
Determine if an array is special by checking alternating parity for every adjacent pair in linear time.
求出出现两次数字的 XOR 值
Find the XOR of numbers appearing twice by scanning the array and using a hash table for efficient tracking and combinat…
优质数对的总数 I
Count all good pairs where an element in nums1 is divisible by a scaled element in nums2 using efficient array scanning.
候诊室中的最少椅子数
Calculate the minimum number of chairs needed in a waiting room using string simulation and event tracking efficiently.
清除数字
Remove all digits from a given string by applying a repeated operation to form the final string without digits.
找出 K 秒后拿着球的孩子
Find the child who holds the ball after k seconds of passing in a queue, considering reversals at both ends.
构成整天的下标对数目 I
Count all pairs in an array where their sum forms a complete day using hash-based counting for efficiency.
使所有元素都可以被 3 整除的最少操作数
Find the minimum number of operations to make all elements in an array divisible by three.
最小元素和最大元素的最小平均值
Solve the Minimum Average of Smallest and Largest Elements problem using two-pointer scanning to track averages effectiv…
三角形的最大高度
Find the maximum height of a triangle that can be formed using red and blue balls under given constraints.
交替组 I
Count all alternating groups in a circular array by tracking tiles with distinct neighbors efficiently using sliding win…
找出加密后的字符串
In this problem, you need to encrypt a string by shifting each character's position based on a given integer value.
交换后字典序最小的字符串
Lexicographically Smallest String After a Swap involves finding the smallest string after swapping adjacent digits with …
求出硬币游戏的赢家
In this game between Alice and Bob, players must pick coins summing to 115. Alice starts, and the goal is to determine t…
使两个整数相等的位更改次数
Find the number of bit changes to make two integers equal using bit manipulation techniques.
判断是否可以赢得数字游戏
Determine if Alice can guarantee a win in a game by selectively summing single or double-digit numbers from an array.
求出胜利玩家的数目
Find how many players in a game win by picking more balls of a single color than their index position.
设计相邻元素求和服务
Design a service that computes sums for adjacent and diagonal elements in a 2D grid.
矩阵中的蛇
Solve the Snake in Matrix problem by simulating the snake's movement in a grid based on a series of directional commands…
统计满足 K 约束的子字符串数量 I
Count all substrings in a binary string that meet a given k-constraint using an efficient sliding window approach.
K 次乘运算后的最终数组 I
Solve the problem of determining the final state of an array after multiple multiplication operations using a priority q…
求出数字答案
Determine the four-digit key from three given numbers using a precise math-driven approach for exact digit alignment.
检查棋盘方格颜色是否相同
Determine if two chessboard squares share the same color using coordinate math and simple string manipulation for quick …
将日期转换为二进制表示
Convert a given Gregorian date string to its binary format by transforming year, month, and day individually without lea…
找到稳定山的下标
Find the indices of stable mountains in an array of mountain heights based on a threshold.
数字小镇中的捣蛋鬼
Find the two numbers that appear twice in a list of integers from 0 to n-1 using array scanning plus hash lookup efficie…
替换为数位和以后的最小元素
Replace each number with its digit sum and return the smallest resulting value, using array plus math techniques efficie…
找出第 K 个字符 I
Find the K-th character in a progressively built string using math and bit manipulation efficiently.
构造最小位运算数组 I
Learn how to construct an array minimizing each element while matching given primes using bitwise operations efficiently…
计算子数组的 x-sum I
Compute the x-sum of every subarray of length k efficiently using array scanning combined with hash lookup techniques.
找到初始输入字符串 I
Determine the length of the original string Alice intended to type by analyzing repeated characters and clumsy key press…
检查平衡字符串
Determine if a numeric string is balanced by comparing sums of digits at even and odd positions efficiently.
最小可整除数位乘积 I
Find the smallest number greater than or equal to n whose digit product is divisible by t.
检测相邻递增子数组 I
Check if an array contains two adjacent strictly increasing subarrays of length k using an array-driven approach efficie…
使数组元素等于零
Learn how to transform an integer array to zeros using simulation and directional selection efficiently and reliably.
移除石头游戏
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…
最小正和子数组
Find the minimum sum of any subarray of size between l and r with a positive total using efficient sliding window logic.
仅含置位位的最小整数
Find the smallest number greater than or equal to n with all set bits in its binary representation.
使数组的值全部为 K 的最少操作次数
Find the minimum operations to convert an array to all values equal k using array scanning and hash lookup efficiently.
转换数组
Simulate operations on a circular array to return a transformed result array following specific rules.
按下时间最长的按钮
Determine which button a child pressed the longest using an array-driven strategy to track time differences efficiently.
统计符合条件长度为 3 的子数组数目
Determine how many subarrays of length three satisfy a sum condition on their first and third elements in an array.
使数组元素互不相同所需的最少操作次数
Find the minimum number of operations to make all elements of an array distinct.
使每一列严格递增的最少操作次数
Calculate the minimum increments to make each column of a matrix strictly increasing using a greedy invariant approach.
子字符串匹配模式
Determine if a pattern containing a single wildcard can match any substring of a given string efficiently.
最长乘积等价子数组
This problem involves finding the longest subarray where the product equals the LCM multiplied by the GCD, leveraging a …
跳过交替单元格的之字形遍历
Traverse a 2D grid in a zigzag pattern while skipping alternate cells, focusing on array and matrix manipulation challen…
循环数组中相邻元素的最大差值
Find the maximum absolute difference between adjacent elements in a circular array using a straightforward array-driven …
变长子数组求和
Calculate the total sum of all elements in subarrays defined for each index in an array, using the array plus prefix sum…
统计元素和差值为偶数的分区方案
Count the number of partitions with an even sum difference from an array of integers.
找到字符串中合法的相邻数字
Identify the first valid adjacent digit pair in a string where each digit appears exactly as many times as its numeric v…
奇偶频次间的最大差值 I
Find the maximum difference between the frequency of characters in a string with odd and even frequencies.
好数字之和
The problem asks for the sum of all good numbers in an array based on specific conditions of neighboring elements.
找出长度为 K 的特殊子字符串
Check efficiently if a string contains a consecutive sequence of length k where all characters match exactly one distinc…
判断操作后字符串中的数字是否相等 I
Simulate repeated adjacent digit sums modulo 10 until two digits remain, then check whether those final digits match.
将数组按照奇偶性转化
Transform an array by sorting even numbers first, followed by odd numbers.
找出最大的几近缺失整数
Find the largest almost missing integer in an array where it appears in exactly one subarray of size k.
水果成篮 II
Determine the number of fruit types that remain unplaced after all allocations in the "Fruits Into Baskets II" problem.
不同三位偶数的数目
Given an array of digits, find how many distinct 3-digit even numbers can be formed without repetition of digits and no …
删除后的最大子数组元素和
Maximize the sum of a subarray after performing deletions, ensuring elements remain unique.
船上可以装载的最大集装箱数量
Determine the maximum number of containers that can be loaded onto a ship's deck without exceeding weight limits.
字符串的反转度
Calculate the reverse degree of a string by simulating operations on its characters based on their positions in the alph…
到达每个位置的最小费用
Calculate the minimum swap costs to reach each position in a line using a precise array-driven strategy for efficiency.
移除最小数对使数组有序 I
This problem asks for the minimum number of operations to make an array non-decreasing by removing pairs of elements.
使数组和能被 K 整除的最少操作次数
This problem asks you to find the minimum operations to make the sum of an array divisible by a given integer k.
找到最近的人
Determine which of two people reaches a third person first using a simple math-driven distance comparison strategy.
两个数字的最大乘积
Find the highest product obtainable from any two digits of a given positive integer using math and sorting techniques ef…
找到频率最高的元音和辅音
Given a string, calculate the sum of the most frequent vowel and consonant frequencies.
不同字符数量最多为 K 时的最少删除数
You need to delete characters in a string to reduce its distinct characters to at most k.
数位和等于下标的最小下标
Find the smallest index in an array where the sum of the digits equals the index.
木材运输的最小成本
Calculate the minimum cost to transport two logs using a math-driven strategy considering cutting costs and truck limits…
为视频标题生成标签
Transform a video caption into a valid hashtag by simulating capitalization rules and truncation for long words efficien…
检查元素频次是否为质数
Check if any element in the array has a prime frequency count, leveraging array scanning and hash table lookup.
十六进制和三十六进制转化
Solve Hexadecimal and Hexatrigesimal Conversion by converting n squared to base 16 and n cubed to base 36, then joining …
优惠券校验器
The Coupon Code Validator problem requires filtering and sorting coupons based on specific criteria for validity.
判断整除性
Determine if a positive integer is divisible by the sum of its digits plus their product using a math-driven strategy.
最早完成陆地和水上游乐设施的时间 I
Find the earliest time a tourist can finish one land and one water ride in a theme park.
三段式数组 I
Determine if an integer array contains indices forming a trionic sequence for efficient pattern detection in interviews.
该难度高频题型
Guided Practice Path
AI recommends problems by your level and tracks your progress.
Start Guided Patharrow_forward