leetcode.com 2026-11-18
🟡2914.minimum-number-of-changes-to-make-binary-string-beautiful
🏷️ Tags
#string
🟡2914.minimum-number-of-changes-to-make-binary-string-beautiful
🏷️ Tags
#string
Telegraph
minimum-number-of-changes-to-make-binary-string-beautiful
You are given a 0-indexed binary string s having an even length. A string is beautiful if it's possible to partition it into one or more substrings such that:
leetcode.cn 2026-11-20
🔴3041.maximize-consecutive-elements-in-an-array-after-modification
🏷️ Tags
#array #dynamic_programming #sorting
🔴3041.maximize-consecutive-elements-in-an-array-after-modification
🏷️ Tags
#array #dynamic_programming #sorting
Telegraph
maximize-consecutive-elements-in-an-array-after-modification
给你一个下标从 0 开始只包含 正 整数的数组 nums 。 一开始,你可以将数组中 任意数量 元素增加 至多 1 。 修改后,你可以从最终数组中选择 一个或者更多 元素,并确保这些元素升序排序后是 连续 的。比方说,[3, 4, 5] 是连续的,但是 [3, 4, 6] 和 [1, 1, 2, 3] 不是连续的。 请你返回 最多 可以选出的元素数目。 示例 1: 输入:nums = [2,1,5,1,1] 输出:3 解释:我们将下标 0 和 3 处的元素增加 1 ,得到结果数组 nums = [3…
leetcode.com 2026-11-20
🔴3041.maximize-consecutive-elements-in-an-array-after-modification
🏷️ Tags
#array #dynamic_programming #sorting
🔴3041.maximize-consecutive-elements-in-an-array-after-modification
🏷️ Tags
#array #dynamic_programming #sorting
Telegraph
maximize-consecutive-elements-in-an-array-after-modification
You are given a 0-indexed array nums consisting of positive integers. Initially, you can increase the value of any element in the array by at most 1. After that, you need to select one or more elements from the final array such that those elements are consecutive…
leetcode.cn 2026-11-21
🟡3331.find-subtree-sizes-after-changes
🏷️ Tags
#tree #depth_first_search #array #hash_table #string
🟡3331.find-subtree-sizes-after-changes
🏷️ Tags
#tree #depth_first_search #array #hash_table #string
Telegraph
find-subtree-sizes-after-changes
给你一棵 n 个节点且根节点为编号 0 的树,节点编号为 0 到 n - 1 。这棵树用一个长度为 n 的数组 parent 表示,其中 parent[i] 是第 i 个节点的父亲节点的编号。由于节点 0 是根,parent[0] == -1 。 给你一个长度为 n 的字符串 s ,其中 s[i] 是节点 i 对应的字符。 对于节点编号从 1 到 n - 1 的每个节点 x ,我们 同时 执行以下操作 一次 :
leetcode.com 2026-11-21
🟡3331.find-subtree-sizes-after-changes
🏷️ Tags
#tree #depth_first_search #array #hash_table #string
🟡3331.find-subtree-sizes-after-changes
🏷️ Tags
#tree #depth_first_search #array #hash_table #string
Telegraph
find-subtree-sizes-after-changes
You are given a tree rooted at node 0 that consists of n nodes numbered from 0 to n - 1. The tree is represented by an array parent of size n, where parent[i] is the parent of node i. Since node 0 is the root, parent[0] == -1. You are also given a string…