leetcode.cn 2025-07-24
🔴2322.minimum-score-after-removals-on-a-tree
🏷️ Tags
#bit_manipulation #tree #depth_first_search #array
🔴2322.minimum-score-after-removals-on-a-tree
🏷️ Tags
#bit_manipulation #tree #depth_first_search #array
Telegraph
minimum-score-after-removals-on-a-tree
存在一棵无向连通树,树中有编号从 0 到 n - 1 的 n 个节点, 以及 n - 1 条边。 给你一个下标从 0 开始的整数数组 nums ,长度为 n ,其中 nums[i] 表示第 i 个节点的值。另给你一个二维整数数组 edges ,长度为 n - 1 ,其中 edges[i] = [ai, bi] 表示树中存在一条位于节点 ai 和 bi 之间的边。 删除树中两条 不同 的边以形成三个连通组件。对于一种删除边方案,定义如下步骤以计算其分数:
leetcode.com 2025-07-24
🔴2322.minimum-score-after-removals-on-a-tree
🏷️ Tags
#bit_manipulation #tree #depth_first_search #array
🔴2322.minimum-score-after-removals-on-a-tree
🏷️ Tags
#bit_manipulation #tree #depth_first_search #array
Telegraph
minimum-score-after-removals-on-a-tree
There is an undirected connected tree with n nodes labeled from 0 to n - 1 and n - 1 edges. You are given a 0-indexed integer array nums of length n where nums[i] represents the value of the ith node. You are also given a 2D integer array edges of length…
leetcode.cn 2025-07-25
🟢3487.maximum-unique-subarray-sum-after-deletion
🏷️ Tags
#greedy #array #hash_table
🟢3487.maximum-unique-subarray-sum-after-deletion
🏷️ Tags
#greedy #array #hash_table
Telegraph
maximum-unique-subarray-sum-after-deletion
给你一个整数数组 nums 。 你可以从数组 nums 中删除任意数量的元素,但不能将其变为 空 数组。执行删除操作后,选出 nums 中满足下述条件的一个子数组:
leetcode.com 2025-07-25
🟢3487.maximum-unique-subarray-sum-after-deletion
🏷️ Tags
#greedy #array #hash_table
🟢3487.maximum-unique-subarray-sum-after-deletion
🏷️ Tags
#greedy #array #hash_table
Telegraph
maximum-unique-subarray-sum-after-deletion
You are given an integer array nums. You are allowed to delete any number of elements from nums without making it empty. After performing the deletions, select a subarray of nums such that:
leetcode.cn 2025-07-26
🔴3480.maximize-subarrays-after-removing-one-conflicting-pair
🏷️ Tags
#segment_tree #array #enumeration #prefix_sum
🔴3480.maximize-subarrays-after-removing-one-conflicting-pair
🏷️ Tags
#segment_tree #array #enumeration #prefix_sum
Telegraph
maximize-subarrays-after-removing-one-conflicting-pair
给你一个整数 n,表示一个包含从 1 到 n 按顺序排列的整数数组 nums。此外,给你一个二维数组 conflictingPairs,其中 conflictingPairs[i] = [a, b] 表示 a 和 b 形成一个冲突对。
leetcode.com 2025-07-26
🔴3480.maximize-subarrays-after-removing-one-conflicting-pair
🏷️ Tags
#segment_tree #array #enumeration #prefix_sum
🔴3480.maximize-subarrays-after-removing-one-conflicting-pair
🏷️ Tags
#segment_tree #array #enumeration #prefix_sum
Telegraph
maximize-subarrays-after-removing-one-conflicting-pair
You are given an integer n which represents an array nums containing the numbers from 1 to n in order. Additionally, you are given a 2D array conflictingPairs, where conflictingPairs[i] = [a, b] indicates that a and b form a conflicting pair. Remove exactly…
leetcode.cn 2025-07-28
🟡2044.count-number-of-maximum-bitwise-or-subsets
🏷️ Tags
#bit_manipulation #array #backtracking #enumeration
🟡2044.count-number-of-maximum-bitwise-or-subsets
🏷️ Tags
#bit_manipulation #array #backtracking #enumeration
Telegraph
count-number-of-maximum-bitwise-or-subsets
给你一个整数数组 nums ,请你找出 nums 子集 按位或 可能得到的 最大值 ,并返回按位或能得到最大值的 不同非空子集的数目 。 如果数组 a 可以由数组 b 删除一些元素(或不删除)得到,则认为数组 a 是数组 b 的一个 子集 。如果选中的元素下标位置不一样,则认为两个子集 不同 。 对数组 a 执行 按位或 ,结果等于 a[0] OR a[1] OR ... OR a[a.length - 1](下标从 0 开始)。 示例 1: 输入:nums = [3,1] 输出:2 解释:子集按位或能得到的最大值是…
leetcode.com 2025-07-28
🟡2044.count-number-of-maximum-bitwise-or-subsets
🏷️ Tags
#bit_manipulation #array #backtracking #enumeration
🟡2044.count-number-of-maximum-bitwise-or-subsets
🏷️ Tags
#bit_manipulation #array #backtracking #enumeration
Telegraph
count-number-of-maximum-bitwise-or-subsets
Given an integer array nums, find the maximum possible bitwise OR of a subset of nums and return the number of different non-empty subsets with the maximum bitwise OR. An array a is a subset of an array b if a can be obtained from b by deleting some (possibly…
leetcode.cn 2025-07-29
🟡2411.smallest-subarrays-with-maximum-bitwise-or
🏷️ Tags
#bit_manipulation #array #binary_search #sliding_window
🟡2411.smallest-subarrays-with-maximum-bitwise-or
🏷️ Tags
#bit_manipulation #array #binary_search #sliding_window
Telegraph
smallest-subarrays-with-maximum-bitwise-or
给你一个长度为 n 下标从 0 开始的数组 nums ,数组中所有数字均为非负整数。对于 0 到 n - 1 之间的每一个下标 i ,你需要找出 nums 中一个 最小 非空子数组,它的起始位置为 i (包含这个位置),同时有 最大 的 按位或运算值 。
leetcode.com 2025-07-29
🟡2411.smallest-subarrays-with-maximum-bitwise-or
🏷️ Tags
#bit_manipulation #array #binary_search #sliding_window
🟡2411.smallest-subarrays-with-maximum-bitwise-or
🏷️ Tags
#bit_manipulation #array #binary_search #sliding_window
Telegraph
smallest-subarrays-with-maximum-bitwise-or
You are given a 0-indexed array nums of length n, consisting of non-negative integers. For each index i from 0 to n - 1, you must determine the size of the minimum sized non-empty subarray of nums starting at i (inclusive) that has the maximum possible bitwise…
leetcode.cn 2025-07-30
🟡2419.longest-subarray-with-maximum-bitwise-and
🏷️ Tags
#bit_manipulation #brainteaser #array
🟡2419.longest-subarray-with-maximum-bitwise-and
🏷️ Tags
#bit_manipulation #brainteaser #array
Telegraph
longest-subarray-with-maximum-bitwise-and
给你一个长度为 n 的整数数组 nums 。 考虑 nums 中进行 按位与(bitwise AND)运算得到的值 最大 的 非空 子数组。
leetcode.com 2025-07-30
🟡2419.longest-subarray-with-maximum-bitwise-and
🏷️ Tags
#bit_manipulation #brainteaser #array
🟡2419.longest-subarray-with-maximum-bitwise-and
🏷️ Tags
#bit_manipulation #brainteaser #array
Telegraph
longest-subarray-with-maximum-bitwise-and
You are given an integer array nums of size n. Consider a non-empty subarray from nums that has the maximum possible bitwise AND.
leetcode.com 2025-07-31
🟡898.bitwise-ors-of-subarrays
🏷️ Tags
#bit_manipulation #array #dynamic_programming
🟡898.bitwise-ors-of-subarrays
🏷️ Tags
#bit_manipulation #array #dynamic_programming
Telegraph
bitwise-ors-of-subarrays
Given an integer array arr, return the number of distinct bitwise ORs of all the non-empty subarrays of arr. The bitwise OR of a subarray is the bitwise OR of each integer in the subarray. The bitwise OR of a subarray of one integer is that integer. A subarray…