leetcode.com 2026-08-07
🔴3348.smallest-divisible-digit-product-ii
🏷️ Tags
#greedy #math #string #backtracking #number_theory
🔴3348.smallest-divisible-digit-product-ii
🏷️ Tags
#greedy #math #string #backtracking #number_theory
Telegraph
smallest-divisible-digit-product-ii
You are given a string num which represents a positive integer, and an integer t. A number is called zero-free if none of its digits are 0. Return a string representing the smallest zero-free number greater than or equal to num such that the product of its…
leetcode.cn 2026-08-08
🟡3302.find-the-lexicographically-smallest-valid-sequence
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming
🟡3302.find-the-lexicographically-smallest-valid-sequence
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming
Telegraph
find-the-lexicographically-smallest-valid-sequence
给你两个字符串 word1 和 word2 。 如果一个字符串 x 修改 至多 一个字符会变成 y ,那么我们称它与 y 几乎相等 。 如果一个下标序列 seq 满足以下条件,我们称它是 合法的 :
leetcode.com 2026-08-08
🟡3302.find-the-lexicographically-smallest-valid-sequence
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming
🟡3302.find-the-lexicographically-smallest-valid-sequence
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming
Telegraph
find-the-lexicographically-smallest-valid-sequence
You are given two strings word1 and word2. A string x is called almost equal to y if you can change at most one character in x to make it identical to y. A sequence of indices seq is called valid if:
leetcode.cn 2026-08-09
🟡1140.stone-game-ii
🏷️ Tags
#minimax_algorithm #array #math #dynamic_programming #game_theory #prefix_sum #zero_sum_game
🟡1140.stone-game-ii
🏷️ Tags
#minimax_algorithm #array #math #dynamic_programming #game_theory #prefix_sum #zero_sum_game
Telegraph
stone-game-ii
Alice 和 Bob 继续他们的石子游戏。许多堆石子 排成一行,每堆都有正整数颗石子 piles[i]。游戏以谁手中的石子最多来决出胜负。 Alice 和 Bob 轮流进行,Alice 先开始。最初,M = 1。 在每个玩家的回合中,该玩家可以拿走剩下的 前 X 堆的所有石子,其中 1 <= X <= 2M。然后,令 M = max(M, X)。 游戏一直持续到所有石子都被拿走。 假设 Alice 和 Bob 都发挥出最佳水平,返回 Alice 可以得到的最大数量的石头。 示例 1: 输入:piles…
leetcode.com 2026-08-09
🟡1140.stone-game-ii
🏷️ Tags
#minimax_algorithm #array #math #dynamic_programming #game_theory #prefix_sum #zero_sum_game
🟡1140.stone-game-ii
🏷️ Tags
#minimax_algorithm #array #math #dynamic_programming #game_theory #prefix_sum #zero_sum_game
Telegraph
stone-game-ii
Alice and Bob continue their games with piles of stones. There are a number of piles arranged in a row, and each pile has a positive integer number of stones piles[i]. The objective of the game is to end with the most stones. Alice and Bob take turns, with…
leetcode.cn 2026-08-10
🔴1510.stone-game-iv
🏷️ Tags
#minimax_algorithm #math #dynamic_programming #game_theory #nim_game #sprague_grundy_theorem #zero_sum_game
🔴1510.stone-game-iv
🏷️ Tags
#minimax_algorithm #math #dynamic_programming #game_theory #nim_game #sprague_grundy_theorem #zero_sum_game
Telegraph
stone-game-iv
Alice 和 Bob 两个人轮流玩一个游戏,Alice 先手。 一开始,有 n 个石子堆在一起。每个人轮流操作,正在操作的玩家可以从石子堆里拿走 任意 非零 平方数 个石子。 如果石子堆里没有石子了,则无法操作的玩家输掉游戏。 给你正整数 n ,且已知两个人都采取最优策略。如果 Alice 会赢得比赛,那么返回 True ,否则返回 False 。 示例 1: 输入:n = 1 输出:true 解释:Alice 拿走 1 个石子并赢得胜利,因为 Bob 无法进行任何操作。 示例 2: 输入:n =…
leetcode.com 2026-08-10
🔴1510.stone-game-iv
🏷️ Tags
#minimax_algorithm #math #dynamic_programming #game_theory #nim_game #sprague_grundy_theorem #zero_sum_game
🔴1510.stone-game-iv
🏷️ Tags
#minimax_algorithm #math #dynamic_programming #game_theory #nim_game #sprague_grundy_theorem #zero_sum_game
Telegraph
stone-game-iv
Alice and Bob take turns playing a game, with Alice starting first. Initially, there are n stones in a pile. On each player's turn, that player makes a move consisting of removing any non-zero square number of stones in the pile. Also, if a player cannot…
leetcode.cn 2026-08-11
🟢2996.smallest-missing-integer-greater-than-sequential-prefix-sum
🏷️ Tags
#array #hash_table #sorting
🟢2996.smallest-missing-integer-greater-than-sequential-prefix-sum
🏷️ Tags
#array #hash_table #sorting
Telegraph
smallest-missing-integer-greater-than-sequential-prefix-sum
给你一个下标从 0 开始的整数数组 nums 。 如果一个前缀 nums[0..i] 满足对于 1 <= j <= i 的所有元素都有 nums[j] = nums[j - 1] + 1 ,那么我们称这个前缀是一个 顺序前缀 。特殊情况是,只包含 nums[0] 的前缀也是一个 顺序前缀 。 请你返回 nums 中没有出现过的 最小 整数 x ,满足 x 大于等于 最长 顺序前缀的和。 示例 1: 输入:nums = [1,2,3,2,5] 输出:6 解释:nums 的最长顺序前缀是 [1,2,3]…
leetcode.com 2026-08-11
🟢2996.smallest-missing-integer-greater-than-sequential-prefix-sum
🏷️ Tags
#array #hash_table #sorting
🟢2996.smallest-missing-integer-greater-than-sequential-prefix-sum
🏷️ Tags
#array #hash_table #sorting
Telegraph
smallest-missing-integer-greater-than-sequential-prefix-sum
You are given a 0-indexed array of integers nums. A prefix nums[0..i] is sequential if, for all 1 <= j <= i, nums[j] = nums[j - 1] + 1. In particular, the prefix consisting only of nums[0] is sequential. Return the smallest integer x missing from nums such…
leetcode.cn 2026-08-12
🟡2958.length-of-longest-subarray-with-at-most-k-frequency
🏷️ Tags
#array #hash_table #sliding_window
🟡2958.length-of-longest-subarray-with-at-most-k-frequency
🏷️ Tags
#array #hash_table #sliding_window
Telegraph
length-of-longest-subarray-with-at-most-k-frequency
给你一个整数数组 nums 和一个整数 k 。 一个元素 x 在数组中的 频率 指的是它在数组中的出现次数。 如果一个数组中所有元素的频率都 小于等于 k ,那么我们称这个数组是 好 数组。 请你返回 nums 中 最长好 子数组的长度。 子数组 指的是一个数组中一段连续非空的元素序列。 示例 1: 输入:nums = [1,2,3,1,2,3,1,2], k = 2 输出:6 解释:最长好子数组是 [1,2,3,1,2,3] ,值 1 ,2 和 3 在子数组中的频率都没有超过 k = 2 。[2,3…
leetcode.com 2026-08-12
🟡2958.length-of-longest-subarray-with-at-most-k-frequency
🏷️ Tags
#array #hash_table #sliding_window
🟡2958.length-of-longest-subarray-with-at-most-k-frequency
🏷️ Tags
#array #hash_table #sliding_window
Telegraph
length-of-longest-subarray-with-at-most-k-frequency
You are given an integer array nums and an integer k. The frequency of an element x is the number of times it occurs in an array. An array is called good if the frequency of each element in this array is less than or equal to k. Return the length of the longest…
leetcode.cn 2026-08-13
🔴2213.longest-substring-of-one-repeating-character
🏷️ Tags
#segment_tree #array #string #ordered_set
🔴2213.longest-substring-of-one-repeating-character
🏷️ Tags
#segment_tree #array #string #ordered_set
Telegraph
longest-substring-of-one-repeating-character
给你一个下标从 0 开始的字符串 s 。另给你一个下标从 0 开始、长度为 k 的字符串 queryCharacters ,一个下标从 0 开始、长度也是 k 的整数 下标 数组 queryIndices ,这两个都用来描述 k 个查询。 第 i 个查询会将 s 中位于下标 queryIndices[i] 的字符更新为 queryCharacters[i] 。 返回一个长度为 k 的数组 lengths ,其中 lengths[i] 是在执行第 i 个查询 之后 s 中仅由 单个字符重复 组成的 最长子字符串…
leetcode.com 2026-08-13
🔴2213.longest-substring-of-one-repeating-character
🏷️ Tags
#segment_tree #array #string #ordered_set
🔴2213.longest-substring-of-one-repeating-character
🏷️ Tags
#segment_tree #array #string #ordered_set
Telegraph
longest-substring-of-one-repeating-character
You are given a 0-indexed string s. You are also given a 0-indexed string queryCharacters of length k and a 0-indexed array of integer indices queryIndices of length k, both of which are used to describe k queries. The ith query updates the character in s…