leetcode.com 2023-08-26
🟡646.maximum-length-of-pair-chain
🏷️ Tags
#greedy #array #dynamic_programming #sorting
🟡646.maximum-length-of-pair-chain
🏷️ Tags
#greedy #array #dynamic_programming #sorting
Telegraph
maximum-length-of-pair-chain
You are given an array of n pairs pairs where pairs[i] = [lefti, righti] and lefti < righti. A pair p2 = [c, d] follows a pair p1 = [a, b] if b < c. A chain of pairs can be formed in this fashion. Return the length longest chain which can be formed. You do…
leetcode.cn 2023-08-29
🟡823.binary-trees-with-factors
🏷️ Tags
#array #hash_table #dynamic_programming #sorting
🟡823.binary-trees-with-factors
🏷️ Tags
#array #hash_table #dynamic_programming #sorting
Telegraph
binary-trees-with-factors
给出一个含有不重复整数元素的数组 arr ,每个整数 arr[i] 均大于 1。 用这些整数来构建二叉树,每个整数可以使用任意次数。其中:每个非叶结点的值应等于它的两个子结点的值的乘积。 满足条件的二叉树一共有多少个?答案可能很大,返回 对 109 + 7 取余 的结果。 示例 1: 输入: arr = [2, 4] 输出: 3 解释: 可以得到这些二叉树: [2], [4], [4, 2, 2] 示例 2: 输入: arr = [2, 4, 5, 10] 输出: 7 解释: 可以得到这些二叉树: [2]…
leetcode.cn 2023-08-30
🟡1654.minimum-jumps-to-reach-home
🏷️ Tags
#breadth_first_search #array #dynamic_programming
🟡1654.minimum-jumps-to-reach-home
🏷️ Tags
#breadth_first_search #array #dynamic_programming
Telegraph
minimum-jumps-to-reach-home
有一只跳蚤的家在数轴上的位置 x 处。请你帮助它从位置 0 出发,到达它的家。 跳蚤跳跃的规则如下:
leetcode.com 2023-08-31
🔴1326.minimum-number-of-taps-to-open-to-water-a-garden
🏷️ Tags
#greedy #array #dynamic_programming
🔴1326.minimum-number-of-taps-to-open-to-water-a-garden
🏷️ Tags
#greedy #array #dynamic_programming
Telegraph
minimum-number-of-taps-to-open-to-water-a-garden
There is a one-dimensional garden on the x-axis. The garden starts at the point 0 and ends at the point n. (i.e The length of the garden is n). There are n + 1 taps located at points [0, 1, ..., n] in the garden. Given an integer n and an integer array ranges…
leetcode.com 2023-09-02
🟡2707.extra-characters-in-a-string
🏷️ Tags
#trie #array #hash_table #string #dynamic_programming
🟡2707.extra-characters-in-a-string
🏷️ Tags
#trie #array #hash_table #string #dynamic_programming
Telegraph
extra-characters-in-a-string
You are given a 0-indexed string s and a dictionary of words dictionary. You have to break s into one or more non-overlapping substrings such that each substring is present in dictionary. There may be some extra characters in s which are not present in any…
leetcode.cn 2023-09-04
🟡449.serialize-and-deserialize-bst
🏷️ Tags
#tree #depth_first_search #breadth_first_search #design #binary_search_tree #string #binary_tree
🟡449.serialize-and-deserialize-bst
🏷️ Tags
#tree #depth_first_search #breadth_first_search #design #binary_search_tree #string #binary_tree
Telegraph
serialize-and-deserialize-bst
序列化是将数据结构或对象转换为一系列位的过程,以便它可以存储在文件或内存缓冲区中,或通过网络连接链路传输,以便稍后在同一个或另一个计算机环境中重建。 设计一个算法来序列化和反序列化 二叉搜索树 。 对序列化/反序列化算法的工作方式没有限制。 您只需确保二叉搜索树可以序列化为字符串,并且可以将该字符串反序列化为最初的二叉搜索树。 编码的字符串应尽可能紧凑。 示例 1: 输入:root = [2,1,3] 输出:[2,1,3] 示例 2: 输入:root = [] 输出:[] 提示:
leetcode.cn 2023-09-05
🟢2605.form-smallest-number-from-two-digit-arrays
🏷️ Tags
#array #hash_table #enumeration
🟢2605.form-smallest-number-from-two-digit-arrays
🏷️ Tags
#array #hash_table #enumeration
Telegraph
form-smallest-number-from-two-digit-arrays
示例 1: 输入:nums1 = [4,1,3], nums2 = [5,7] 输出:15 解释:数字 15 的数位 1 在 nums1 中出现,数位 5 在 nums2 中出现。15 是我们能得到的最小数字。 示例 2: 输入:nums1 = [3,5,2,6], nums2 = [3,1,7] 输出:3 解释:数字 3 的数位 3 在两个数组中都出现了。 提示: