leetcode.com 2025-08-07
🔴3363.find-the-maximum-number-of-fruits-collected
🏷️ Tags
#array #dynamic_programming #matrix
🔴3363.find-the-maximum-number-of-fruits-collected
🏷️ Tags
#array #dynamic_programming #matrix
Telegraph
find-the-maximum-number-of-fruits-collected
There is a game dungeon comprised of n x n rooms arranged in a grid. You are given a 2D array fruits of size n x n, where fruits[i][j] represents the number of fruits in the room (i, j). Three children will play in the game dungeon, with initial positions…
leetcode.com 2025-08-08
🟡808.soup-servings
🏷️ Tags
#math #dynamic_programming #probability_and_statistics
🟡808.soup-servings
🏷️ Tags
#math #dynamic_programming #probability_and_statistics
Telegraph
soup-servings
You have two soups, A and B, each starting with n mL. On every turn, one of the following four serving operations is chosen at random, each with probability 0.25 independent of all previous turns:
leetcode.com 2025-08-10
🟡869.reordered-power-of-2
🏷️ Tags
#hash_table #math #counting #enumeration #sorting
🟡869.reordered-power-of-2
🏷️ Tags
#hash_table #math #counting #enumeration #sorting
Telegraph
reordered-power-of-2
You are given an integer n. We reorder the digits in any order (including the original order) such that the leading digit is not zero. Return true if and only if we can do this so that the resulting number is a power of two. Example 1: Input: n = 1 Output:…
leetcode.cn 2025-08-11
🟡2438.range-product-queries-of-powers
🏷️ Tags
#bit_manipulation #array #prefix_sum
🟡2438.range-product-queries-of-powers
🏷️ Tags
#bit_manipulation #array #prefix_sum
Telegraph
range-product-queries-of-powers
给你一个正整数 n ,你需要找到一个下标从 0 开始的数组 powers ,它包含 最少 数目的 2 的幂,且它们的和为 n 。powers 数组是 非递减 顺序的。根据前面描述,构造 powers 数组的方法是唯一的。 同时给你一个下标从 0 开始的二维整数数组 queries ,其中 queries[i] = [lefti, righti] ,其中 queries[i] 表示请你求出满足 lefti <= j <= righti 的所有 powers[j] 的乘积。 请你返回一个数组 answers…
leetcode.com 2025-08-11
🟡2438.range-product-queries-of-powers
🏷️ Tags
#bit_manipulation #array #prefix_sum
🟡2438.range-product-queries-of-powers
🏷️ Tags
#bit_manipulation #array #prefix_sum
Telegraph
range-product-queries-of-powers
Given a positive integer n, there exists a 0-indexed array called powers, composed of the minimum number of powers of 2 that sum to n. The array is sorted in non-decreasing order, and there is only one way to form the array. You are also given a 0-indexed…
leetcode.cn 2025-08-17
🟡837.new-21-game
🏷️ Tags
#math #dynamic_programming #sliding_window #probability_and_statistics
🟡837.new-21-game
🏷️ Tags
#math #dynamic_programming #sliding_window #probability_and_statistics
Telegraph
new-21-game
爱丽丝参与一个大致基于纸牌游戏 “21点” 规则的游戏,描述如下: 爱丽丝以 0 分开始,并在她的得分少于 k 分时抽取数字。 抽取时,她从 [1, maxPts] 的范围中随机获得一个整数作为分数进行累计,其中 maxPts 是一个整数。 每次抽取都是独立的,其结果具有相同的概率。 当爱丽丝获得 k 分 或更多分 时,她就停止抽取数字。 爱丽丝的分数不超过 n 的概率是多少? 与实际答案误差不超过 10-5 的答案将被视为正确答案。
leetcode.com 2025-08-17
🟡837.new-21-game
🏷️ Tags
#math #dynamic_programming #sliding_window #probability_and_statistics
🟡837.new-21-game
🏷️ Tags
#math #dynamic_programming #sliding_window #probability_and_statistics
Telegraph
new-21-game
Alice plays the following game, loosely based on the card game "21". Alice starts with 0 points and draws numbers while she has less than k points. During each draw, she gains an integer number of points randomly from the range [1, maxPts], where maxPts is…