leetcode.com 2023-08-03
🟡17.letter-combinations-of-a-phone-number
🏷️ Tags
#hash_table #string #backtracking
🟡17.letter-combinations-of-a-phone-number
🏷️ Tags
#hash_table #string #backtracking
Telegraph
letter-combinations-of-a-phone-number
Given a string containing digits from 2-9 inclusive, return all possible letter combinations that the number could represent. Return the answer in any order. A mapping of digits to letters (just like on the telephone buttons) is given below. Note that 1 does…
leetcode.com 2023-08-05
🟡95.unique-binary-search-trees-ii
🏷️ Tags
#tree #binary_search_tree #dynamic_programming #backtracking #binary_tree
🟡95.unique-binary-search-trees-ii
🏷️ Tags
#tree #binary_search_tree #dynamic_programming #backtracking #binary_tree
Telegraph
unique-binary-search-trees-ii
Given an integer n, return all the structurally unique BST's (binary search trees), which has exactly n nodes of unique values from 1 to n. Return the answer in any order. Example 1: Input: n = 3 Output: [[1,null,2,null,3],[1,null,3,2],[2,1,3],[3,1,null…
leetcode.cn 2023-12-09
🟡2048.next-greater-numerically-balanced-number
🏷️ Tags
#math #backtracking #enumeration
🟡2048.next-greater-numerically-balanced-number
🏷️ Tags
#math #backtracking #enumeration
Telegraph
next-greater-numerically-balanced-number
如果整数 x 满足:对于每个数位 d ,这个数位 恰好 在 x 中出现 d 次。那么整数 x 就是一个 数值平衡数 。 给你一个整数 n ,请你返回 严格大于 n 的 最小数值平衡数 。 示例 1: 输入:n = 1 输出:22 解释: 22 是一个数值平衡数,因为: - 数字 2 出现 2 次 这也是严格大于 1 的最小数值平衡数。 示例 2: 输入:n = 1000 输出:1333 解释: 1333 是一个数值平衡数,因为: - 数字 1 出现 1 次。 - 数字 3 出现 3 次。 这也是严格大于…
leetcode.cn 2024-01-04
🟡2397.maximum-rows-covered-by-columns
🏷️ Tags
#bit_manipulation #array #backtracking #enumeration #matrix
🟡2397.maximum-rows-covered-by-columns
🏷️ Tags
#bit_manipulation #array #backtracking #enumeration #matrix
Telegraph
maximum-rows-covered-by-columns
给你一个下标从 0 开始、大小为 m x n 的二进制矩阵 matrix ;另给你一个整数 numSelect,表示你必须从 matrix 中选择的 不同 列的数量。 如果一行中所有的 1 都被你选中的列所覆盖,则认为这一行被 覆盖 了。 形式上,假设 s = {c1, c2, ...., cnumSelect} 是你选择的列的集合。对于矩阵中的某一行 row ,如果满足下述条件,则认为这一行被集合 s 覆盖:
leetcode.com 2024-01-23
🟡1239.maximum-length-of-a-concatenated-string-with-unique-characters
🏷️ Tags
#bit_manipulation #array #string #backtracking
🟡1239.maximum-length-of-a-concatenated-string-with-unique-characters
🏷️ Tags
#bit_manipulation #array #string #backtracking
Telegraph
maximum-length-of-a-concatenated-string-with-unique-characters
You are given an array of strings arr. A string s is formed by the concatenation of a subsequence of arr that has unique characters. Return the maximum possible length of s. A subsequence is an array that can be derived from another array by deleting some…
leetcode.cn 2025-03-07
🟡2597.the-number-of-beautiful-subsets
🏷️ Tags
#array #hash_table #math #dynamic_programming #backtracking #combinatorics #sorting
🟡2597.the-number-of-beautiful-subsets
🏷️ Tags
#array #hash_table #math #dynamic_programming #backtracking #combinatorics #sorting
Telegraph
the-number-of-beautiful-subsets
给你一个由正整数组成的数组 nums 和一个 正 整数 k 。 如果 nums 的子集中,任意两个整数的绝对差均不等于 k ,则认为该子数组是一个 美丽 子集。 返回数组 nums 中 非空 且 美丽 的子集数目。 nums 的子集定义为:可以经由 nums 删除某些元素(也可能不删除)得到的一个数组。只有在删除元素时选择的索引不同的情况下,两个子集才会被视作是不同的子集。 示例 1: 输入:nums = [2,4,6], k = 2 输出:4 解释:数组 nums 中的美丽子集有:[2], [4]…