leetcode.com 2026-08-03
🔴1406.stone-game-iii
🏷️ Tags
#minimax_algorithm #array #math #dynamic_programming #game_theory #zero_sum_game
🔴1406.stone-game-iii
🏷️ Tags
#minimax_algorithm #array #math #dynamic_programming #game_theory #zero_sum_game
Telegraph
stone-game-iii
Alice and Bob continue their games with piles of stones. There are several stones arranged in a row, and each stone has an associated value which is an integer given in the array stoneValue. Alice and Bob take turns, with Alice starting first. On each player's…
leetcode.cn 2026-08-05
🟡3310.remove-methods-from-project
🏷️ Tags
#depth_first_search #breadth_first_search #graph
🟡3310.remove-methods-from-project
🏷️ Tags
#depth_first_search #breadth_first_search #graph
Telegraph
remove-methods-from-project
你正在维护一个项目,该项目有 n 个方法,编号从 0 到 n - 1。 给你两个整数 n 和 k,以及一个二维整数数组 invocations,其中 invocations[i] = [ai, bi] 表示方法 ai 调用了方法 bi。 已知如果方法 k 存在一个已知的 bug。那么方法 k 以及它直接或间接调用的任何方法都被视为 可疑方法 ,我们需要从项目中移除这些方法。 只有当一组方法没有被这组之外的任何方法调用时,这组方法才能被移除。 返回一个数组,包含移除所有 可疑方法 后剩下的所有方法。你可以…
leetcode.com 2026-08-05
🟡3310.remove-methods-from-project
🏷️ Tags
#depth_first_search #breadth_first_search #graph
🟡3310.remove-methods-from-project
🏷️ Tags
#depth_first_search #breadth_first_search #graph
Telegraph
remove-methods-from-project
You are maintaining a project that has n methods numbered from 0 to n - 1. You are given two integers n and k, and a 2D integer array invocations, where invocations[i] = [ai, bi] indicates that method ai invokes method bi. There is a known bug in method k.…
leetcode.cn 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
给你一个字符串 num ,表示一个 正 整数,同时给你一个整数 t 。 如果一个整数 没有 任何数位是 0 ,那么我们称这个整数是 无零 数字。
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…