leetcode.cn 2025-03-30
🟡2109.adding-spaces-to-a-string
🏷️ Tags
#array #two_pointers #string #simulation
🟡2109.adding-spaces-to-a-string
🏷️ Tags
#array #two_pointers #string #simulation
Telegraph
adding-spaces-to-a-string
给你一个下标从 0 开始的字符串 s ,以及一个下标从 0 开始的整数数组 spaces 。 数组 spaces 描述原字符串中需要添加空格的下标。每个空格都应该插入到给定索引处的字符值 之前 。
leetcode.cn 2025-04-04
🟡1123.lowest-common-ancestor-of-deepest-leaves
🏷️ Tags
#tree #depth_first_search #breadth_first_search #hash_table #binary_tree
🟡1123.lowest-common-ancestor-of-deepest-leaves
🏷️ Tags
#tree #depth_first_search #breadth_first_search #hash_table #binary_tree
Telegraph
lowest-common-ancestor-of-deepest-leaves
给你一个有根节点 root 的二叉树,返回它 最深的叶节点的最近公共祖先 。 回想一下:
leetcode.com 2025-04-04
🟡1123.lowest-common-ancestor-of-deepest-leaves
🏷️ Tags
#tree #depth_first_search #breadth_first_search #hash_table #binary_tree
🟡1123.lowest-common-ancestor-of-deepest-leaves
🏷️ Tags
#tree #depth_first_search #breadth_first_search #hash_table #binary_tree
Telegraph
lowest-common-ancestor-of-deepest-leaves
Given the root of a binary tree, return the lowest common ancestor of its deepest leaves. Recall that:
leetcode.cn 2025-04-05
🟢1863.sum-of-all-subset-xor-totals
🏷️ Tags
#bit_manipulation #array #math #backtracking #combinatorics #enumeration
🟢1863.sum-of-all-subset-xor-totals
🏷️ Tags
#bit_manipulation #array #math #backtracking #combinatorics #enumeration
Telegraph
sum-of-all-subset-xor-totals
一个数组的 异或总和 定义为数组中所有元素按位 XOR 的结果;如果数组为 空 ,则异或总和为 0 。
leetcode.com 2025-04-05
🟢1863.sum-of-all-subset-xor-totals
🏷️ Tags
#bit_manipulation #array #math #backtracking #combinatorics #enumeration
🟢1863.sum-of-all-subset-xor-totals
🏷️ Tags
#bit_manipulation #array #math #backtracking #combinatorics #enumeration
Telegraph
sum-of-all-subset-xor-totals
The XOR total of an array is defined as the bitwise XOR of all its elements, or 0 if the array is empty.
leetcode.cn 2025-04-06
🟡368.largest-divisible-subset
🏷️ Tags
#array #math #dynamic_programming #sorting
🟡368.largest-divisible-subset
🏷️ Tags
#array #math #dynamic_programming #sorting
Telegraph
largest-divisible-subset
answer[i] % answer[j] == 0 ,或
leetcode.cn 2025-04-08
🟢3396.minimum-number-of-operations-to-make-elements-in-array-distinct
🏷️ Tags
#array #hash_table
🟢3396.minimum-number-of-operations-to-make-elements-in-array-distinct
🏷️ Tags
#array #hash_table
Telegraph
minimum-number-of-operations-to-make-elements-in-array-distinct
给你一个整数数组 nums,你需要确保数组中的元素 互不相同 。为此,你可以执行以下操作任意次:
leetcode.com 2025-04-08
🟢3396.minimum-number-of-operations-to-make-elements-in-array-distinct
🏷️ Tags
#array #hash_table
🟢3396.minimum-number-of-operations-to-make-elements-in-array-distinct
🏷️ Tags
#array #hash_table
Telegraph
minimum-number-of-operations-to-make-elements-in-array-distinct
You are given an integer array nums. You need to ensure that the elements in the array are distinct. To achieve this, you can perform the following operation any number of times:
leetcode.com 2025-04-09
🟢3375.minimum-operations-to-make-array-values-equal-to-k
🏷️ Tags
#array #hash_table
🟢3375.minimum-operations-to-make-array-values-equal-to-k
🏷️ Tags
#array #hash_table
Telegraph
minimum-operations-to-make-array-values-equal-to-k
You are given an integer array nums and an integer k. An integer h is called valid if all values in the array that are strictly greater than h are identical. For example, if nums = [10, 8, 10, 8], a valid integer is h = 9 because all nums[i] > 9 are equal…