leetcode.cn 2026-06-07
🟡2196.create-binary-tree-from-descriptions
🏷️ Tags
#tree #array #hash_table #binary_tree
🟡2196.create-binary-tree-from-descriptions
🏷️ Tags
#tree #array #hash_table #binary_tree
Telegraph
create-binary-tree-from-descriptions
给你一个二维整数数组 descriptions ,其中 descriptions[i] = [parenti, childi, isLefti] 表示 parenti 是 childi 在 二叉树 中的 父节点,二叉树中各节点的值 互不相同 。此外:
leetcode.com 2026-06-07
🟡2196.create-binary-tree-from-descriptions
🏷️ Tags
#tree #array #hash_table #binary_tree
🟡2196.create-binary-tree-from-descriptions
🏷️ Tags
#tree #array #hash_table #binary_tree
Telegraph
create-binary-tree-from-descriptions
You are given a 2D integer array descriptions where descriptions[i] = [parenti, childi, isLefti] indicates that parenti is the parent of childi in a binary tree of unique values. Furthermore,
leetcode.cn 2026-06-25
🟡3737.count-subarrays-with-majority-element-i
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #counting #prefix_sum #merge_sort
🟡3737.count-subarrays-with-majority-element-i
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #counting #prefix_sum #merge_sort
Telegraph
count-subarrays-with-majority-element-i
给你一个整数数组 nums 和一个整数 target。
leetcode.com 2026-06-25
🟡3737.count-subarrays-with-majority-element-i
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #counting #prefix_sum #merge_sort
🟡3737.count-subarrays-with-majority-element-i
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #counting #prefix_sum #merge_sort
Telegraph
count-subarrays-with-majority-element-i
You are given an integer array nums and an integer target. Return the number of subarrays of nums in which target is the majority element. The majority element of a subarray is the element that appears strictly more than half of the times in that subarray.…
leetcode.cn 2026-06-26
🔴3739.count-subarrays-with-majority-element-ii
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #prefix_sum #merge_sort
🔴3739.count-subarrays-with-majority-element-ii
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #prefix_sum #merge_sort
Telegraph
count-subarrays-with-majority-element-ii
给你一个整数数组 nums 和一个整数 target。
leetcode.com 2026-06-26
🔴3739.count-subarrays-with-majority-element-ii
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #prefix_sum #merge_sort
🔴3739.count-subarrays-with-majority-element-ii
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #prefix_sum #merge_sort
Telegraph
count-subarrays-with-majority-element-ii
You are given an integer array nums and an integer target. Return the number of subarrays of nums in which target is the majority element. The majority element of a subarray is the element that appears strictly more than half of the times in that subarray.…
leetcode.cn 2026-06-27
🟡3020.find-the-maximum-number-of-elements-in-subset
🏷️ Tags
#array #hash_table #enumeration
🟡3020.find-the-maximum-number-of-elements-in-subset
🏷️ Tags
#array #hash_table #enumeration
Telegraph
find-the-maximum-number-of-elements-in-subset
给你一个 正整数 数组 nums 。 你需要从数组中选出一个满足下述条件的子集:
leetcode.com 2026-06-27
🟡3020.find-the-maximum-number-of-elements-in-subset
🏷️ Tags
#array #hash_table #enumeration
🟡3020.find-the-maximum-number-of-elements-in-subset
🏷️ Tags
#array #hash_table #enumeration
Telegraph
find-the-maximum-number-of-elements-in-subset
You are given an array of positive integers nums. You need to select a subset of nums which satisfies the following condition:
leetcode.cn 2026-06-30
🟡1358.number-of-substrings-containing-all-three-characters
🏷️ Tags
#hash_table #string #sliding_window
🟡1358.number-of-substrings-containing-all-three-characters
🏷️ Tags
#hash_table #string #sliding_window
Telegraph
number-of-substrings-containing-all-three-characters
给你一个字符串 s ,它只包含三种字符 a, b 和 c 。 请你返回 a,b 和 c 都 至少 出现过一次的子字符串数目。 示例 1: 输入:s = "abcabc" 输出:10 解释:包含 a,b 和 c 各至少一次的子字符串为 "abc", "abca", "abcab", "abcabc", "bca", "bcab", "bcabc", "cab", "cabc" 和 "abc" (相同字符串算多次)。 示例 2: 输入:s = "aaacb" 输出:3 解释:包含 a,b 和 c 各至少一次的子字符串为…
leetcode.com 2026-06-30
🟡1358.number-of-substrings-containing-all-three-characters
🏷️ Tags
#hash_table #string #sliding_window
🟡1358.number-of-substrings-containing-all-three-characters
🏷️ Tags
#hash_table #string #sliding_window
Telegraph
number-of-substrings-containing-all-three-characters
Given a string s consisting only of characters a, b and c. Return the number of substrings containing at least one occurrence of all these characters a, b and c. Example 1: Input: s = "abcabc" Output: 10 Explanation: The substrings containing at least one…
leetcode.cn 2026-07-09
🟡3532.path-existence-queries-in-a-graph-i
🏷️ Tags
#union_find #graph #array #hash_table #binary_search
🟡3532.path-existence-queries-in-a-graph-i
🏷️ Tags
#union_find #graph #array #hash_table #binary_search
Telegraph
path-existence-queries-in-a-graph-i
给你一个整数 n,表示图中的节点数量,这些节点按从 0 到 n - 1 编号。 同时给你一个长度为 n 的整数数组 nums,该数组按 非递减 顺序排序,以及一个整数 maxDiff。 如果满足 |nums[i] - nums[j]| <= maxDiff(即 nums[i] 和 nums[j] 的 绝对差 至多为 maxDiff),则节点 i 和节点 j 之间存在一条 无向边 。 此外,给你一个二维整数数组 queries。对于每个 queries[i] = [ui, vi],需要判断节点 ui 和 vi…
leetcode.com 2026-07-09
🟡3532.path-existence-queries-in-a-graph-i
🏷️ Tags
#union_find #graph #array #hash_table #binary_search
🟡3532.path-existence-queries-in-a-graph-i
🏷️ Tags
#union_find #graph #array #hash_table #binary_search
Telegraph
path-existence-queries-in-a-graph-i
You are given an integer n representing the number of nodes in a graph, labeled from 0 to n - 1. You are also given an integer array nums of length n sorted in non-decreasing order, and an integer maxDiff. An undirected edge exists between nodes i and j if…
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…