leetcode.cn 2025-06-01
🟡2929.distribute-candies-among-children-ii
🏷️ Tags
#math #combinatorics #enumeration
🟡2929.distribute-candies-among-children-ii
🏷️ Tags
#math #combinatorics #enumeration
Telegraph
distribute-candies-among-children-ii
给你两个正整数 n 和 limit 。 请你将 n 颗糖果分给 3 位小朋友,确保没有任何小朋友得到超过 limit 颗糖果,请你返回满足此条件下的 总方案数 。 示例 1: 输入:n = 5, limit = 2 输出:3 解释:总共有 3 种方法分配 5 颗糖果,且每位小朋友的糖果数不超过 2 :(1, 2, 2) ,(2, 1, 2) 和 (2, 2, 1) 。 示例 2: 输入:n = 3, limit = 3 输出:10 解释:总共有 10 种方法分配 3 颗糖果,且每位小朋友的糖果数不超过…
leetcode.com 2025-06-01
🟡2929.distribute-candies-among-children-ii
🏷️ Tags
#math #combinatorics #enumeration
🟡2929.distribute-candies-among-children-ii
🏷️ Tags
#math #combinatorics #enumeration
Telegraph
distribute-candies-among-children-ii
You are given two positive integers n and limit. Return the total number of ways to distribute n candies among 3 children such that no child gets more than limit candies. Example 1: Input: n = 5, limit = 2 Output: 3 Explanation: There are 3 ways to distribute…
leetcode.cn 2025-06-03
🔴1298.maximum-candies-you-can-get-from-boxes
🏷️ Tags
#breadth_first_search #graph #array
🔴1298.maximum-candies-you-can-get-from-boxes
🏷️ Tags
#breadth_first_search #graph #array
Telegraph
maximum-candies-you-can-get-from-boxes
给你 n 个盒子,每个盒子的格式为 [status, candies, keys, containedBoxes] ,其中:
leetcode.com 2025-06-03
🔴1298.maximum-candies-you-can-get-from-boxes
🏷️ Tags
#breadth_first_search #graph #array
🔴1298.maximum-candies-you-can-get-from-boxes
🏷️ Tags
#breadth_first_search #graph #array
Telegraph
maximum-candies-you-can-get-from-boxes
You have n boxes labeled from 0 to n - 1. You are given four arrays: status, candies, keys, and containedBoxes where:
leetcode.cn 2025-06-04
🟡3403.find-the-lexicographically-largest-string-from-the-box-i
🏷️ Tags
#two_pointers #string #enumeration
🟡3403.find-the-lexicographically-largest-string-from-the-box-i
🏷️ Tags
#two_pointers #string #enumeration
Telegraph
find-the-lexicographically-largest-string-from-the-box-i
给你一个字符串 word 和一个整数 numFriends。 Alice 正在为她的 numFriends 位朋友组织一个游戏。游戏分为多个回合,在每一回合中:
leetcode.com 2025-06-04
🟡3403.find-the-lexicographically-largest-string-from-the-box-i
🏷️ Tags
#two_pointers #string #enumeration
🟡3403.find-the-lexicographically-largest-string-from-the-box-i
🏷️ Tags
#two_pointers #string #enumeration
Telegraph
find-the-lexicographically-largest-string-from-the-box-i
You are given a string word, and an integer numFriends. Alice is organizing a game for her numFriends friends. There are multiple rounds in the game, where in each round:
leetcode.cn 2025-06-06
🟡2434.using-a-robot-to-print-the-lexicographically-smallest-string
🏷️ Tags
#stack #greedy #hash_table #string
🟡2434.using-a-robot-to-print-the-lexicographically-smallest-string
🏷️ Tags
#stack #greedy #hash_table #string
Telegraph
using-a-robot-to-print-the-lexicographically-smallest-string
给你一个字符串 s 和一个机器人,机器人当前有一个空字符串 t 。执行以下操作之一,直到 s 和 t 都变成空字符串:
leetcode.com 2025-06-06
🟡2434.using-a-robot-to-print-the-lexicographically-smallest-string
🏷️ Tags
#stack #greedy #hash_table #string
🟡2434.using-a-robot-to-print-the-lexicographically-smallest-string
🏷️ Tags
#stack #greedy #hash_table #string
Telegraph
using-a-robot-to-print-the-lexicographically-smallest-string
You are given a string s and a robot that currently holds an empty string t. Apply one of the following operations until s and t are both empty:
leetcode.cn 2025-06-07
🟡3170.lexicographically-minimum-string-after-removing-stars
🏷️ Tags
#stack #greedy #hash_table #string #heap_priority_queue
🟡3170.lexicographically-minimum-string-after-removing-stars
🏷️ Tags
#stack #greedy #hash_table #string #heap_priority_queue
Telegraph
lexicographically-minimum-string-after-removing-stars
给你一个字符串 s 。它可能包含任意数量的 '*' 字符。你的任务是删除所有的 '*' 字符。 当字符串还存在至少一个 '*' 字符时,你可以执行以下操作:
leetcode.com 2025-06-07
🟡3170.lexicographically-minimum-string-after-removing-stars
🏷️ Tags
#stack #greedy #hash_table #string #heap_priority_queue
🟡3170.lexicographically-minimum-string-after-removing-stars
🏷️ Tags
#stack #greedy #hash_table #string #heap_priority_queue
Telegraph
lexicographically-minimum-string-after-removing-stars
You are given a string s. It may contain any number of '*' characters. Your task is to remove all '*' characters. While there is a '*', do the following operation:
leetcode.cn 2025-06-10
🟢3442.maximum-difference-between-even-and-odd-frequency-i
🏷️ Tags
#hash_table #string #counting
🟢3442.maximum-difference-between-even-and-odd-frequency-i
🏷️ Tags
#hash_table #string #counting
Telegraph
maximum-difference-between-even-and-odd-frequency-i
给你一个由小写英文字母组成的字符串 s 。 请你找出字符串中两个字符 a1 和 a2 的出现频次之间的 最大 差值 diff = a1 - a2,这两个字符需要满足:
leetcode.com 2025-06-10
🟢3442.maximum-difference-between-even-and-odd-frequency-i
🏷️ Tags
#hash_table #string #counting
🟢3442.maximum-difference-between-even-and-odd-frequency-i
🏷️ Tags
#hash_table #string #counting
Telegraph
maximum-difference-between-even-and-odd-frequency-i
You are given a string s consisting of lowercase English letters. Your task is to find the maximum difference diff = freq(a1) - freq(a2) between the frequency of characters a1 and a2 in the string such that: