leetcode.cn 2026-06-12
🔴3559.number-of-ways-to-assign-edge-weights-ii
🏷️ Tags
#bit_manipulation #tree #depth_first_search #array #math #dynamic_programming
🔴3559.number-of-ways-to-assign-edge-weights-ii
🏷️ Tags
#bit_manipulation #tree #depth_first_search #array #math #dynamic_programming
Telegraph
number-of-ways-to-assign-edge-weights-ii
给你一棵有 n 个节点的无向树,节点从 1 到 n 编号,树以节点 1 为根。树由一个长度为 n - 1 的二维整数数组 edges 表示,其中 edges[i] = [ui, vi] 表示在节点 ui 和 vi 之间有一条边。
leetcode.com 2026-06-12
🔴3559.number-of-ways-to-assign-edge-weights-ii
🏷️ Tags
#bit_manipulation #tree #depth_first_search #array #math #dynamic_programming
🔴3559.number-of-ways-to-assign-edge-weights-ii
🏷️ Tags
#bit_manipulation #tree #depth_first_search #array #math #dynamic_programming
Telegraph
number-of-ways-to-assign-edge-weights-ii
There is an undirected tree with n nodes labeled from 1 to n, rooted at node 1. The tree is represented by a 2D integer array edges of length n - 1, where edges[i] = [ui, vi] indicates that there is an edge between nodes ui and vi. Initially, all edges have…
leetcode.cn 2026-07-08
🟡3756.concatenate-non-zero-digits-and-multiply-by-sum-ii
🏷️ Tags
#math #string #prefix_sum
🟡3756.concatenate-non-zero-digits-and-multiply-by-sum-ii
🏷️ Tags
#math #string #prefix_sum
Telegraph
concatenate-non-zero-digits-and-multiply-by-sum-ii
给你一个长度为 m 的字符串 s,其中仅包含数字。另给你一个二维整数数组 queries,其中 queries[i] = [li, ri]。
leetcode.com 2026-07-08
🟡3756.concatenate-non-zero-digits-and-multiply-by-sum-ii
🏷️ Tags
#math #string #prefix_sum
🟡3756.concatenate-non-zero-digits-and-multiply-by-sum-ii
🏷️ Tags
#math #string #prefix_sum
Telegraph
concatenate-non-zero-digits-and-multiply-by-sum-ii
You are given a string s of length m consisting of digits. You are also given a 2D integer array queries, where queries[i] = [li, ri]. For each queries[i], extract the substring s[li..ri]. Then, perform the following:
leetcode.cn 2026-07-14
🔴3336.find-the-number-of-subsequences-with-equal-gcd
🏷️ Tags
#array #math #dynamic_programming #number_theory
🔴3336.find-the-number-of-subsequences-with-equal-gcd
🏷️ Tags
#array #math #dynamic_programming #number_theory
Telegraph
find-the-number-of-subsequences-with-equal-gcd
给你一个整数数组 nums。 请你统计所有满足以下条件的 非空 子序列 对 (seq1, seq2) 的数量:
leetcode.com 2026-07-14
🔴3336.find-the-number-of-subsequences-with-equal-gcd
🏷️ Tags
#array #math #dynamic_programming #number_theory
🔴3336.find-the-number-of-subsequences-with-equal-gcd
🏷️ Tags
#array #math #dynamic_programming #number_theory
Telegraph
find-the-number-of-subsequences-with-equal-gcd
You are given an integer array nums. Your task is to find the number of pairs of non-empty subsequences (seq1, seq2) of nums that satisfy the following conditions:
leetcode.cn 2026-07-16
🟡3867.sum-of-gcd-of-formed-pairs
🏷️ Tags
#array #math #two_pointers #number_theory #sorting #simulation
🟡3867.sum-of-gcd-of-formed-pairs
🏷️ Tags
#array #math #two_pointers #number_theory #sorting #simulation
Telegraph
sum-of-gcd-of-formed-pairs
给你一个长度为 n 的整数数组 nums。
leetcode.com 2026-07-16
🟡3867.sum-of-gcd-of-formed-pairs
🏷️ Tags
#array #math #two_pointers #number_theory #sorting #simulation
🟡3867.sum-of-gcd-of-formed-pairs
🏷️ Tags
#array #math #two_pointers #number_theory #sorting #simulation
Telegraph
sum-of-gcd-of-formed-pairs
You are given an integer array nums of length n. Construct an array prefixGcd where for each index i:
leetcode.cn 2026-07-17
🔴3312.sorted-gcd-pair-queries
🏷️ Tags
#array #hash_table #math #binary_search #combinatorics #counting #number_theory #prefix_sum
🔴3312.sorted-gcd-pair-queries
🏷️ Tags
#array #hash_table #math #binary_search #combinatorics #counting #number_theory #prefix_sum
Telegraph
sorted-gcd-pair-queries
给你一个长度为 n 的整数数组 nums 和一个整数数组 queries 。 gcdPairs 表示数组 nums 中所有满足 0 <= i < j < n 的数对 (nums[i], nums[j]) 的 最大公约数 升序 排列构成的数组。 对于每个查询 queries[i] ,你需要找到 gcdPairs 中下标为 queries[i] 的元素。
leetcode.com 2026-07-17
🔴3312.sorted-gcd-pair-queries
🏷️ Tags
#array #hash_table #math #binary_search #combinatorics #counting #number_theory #prefix_sum
🔴3312.sorted-gcd-pair-queries
🏷️ Tags
#array #hash_table #math #binary_search #combinatorics #counting #number_theory #prefix_sum
Telegraph
sorted-gcd-pair-queries
You are given an integer array nums of length n and an integer array queries. Let gcdPairs denote an array obtained by calculating the GCD of all possible pairs (nums[i], nums[j]), where 0 <= i < j < n, and then sorting these values in ascending order. For…
leetcode.com 2026-07-18
🟢1979.find-greatest-common-divisor-of-array
🏷️ Tags
#array #math #number_theory
🟢1979.find-greatest-common-divisor-of-array
🏷️ Tags
#array #math #number_theory
Telegraph
find-greatest-common-divisor-of-array
Given an integer array nums, return the greatest common divisor of the smallest number and largest number in nums. The greatest common divisor of two numbers is the largest positive integer that evenly divides both numbers. Example 1: Input: nums = [2,5…