leetcode.cn 2026-07-22
🔴3501.maximize-active-section-with-trade-ii
🏷️ Tags
#segment_tree #array #string #binary_search
🔴3501.maximize-active-section-with-trade-ii
🏷️ Tags
#segment_tree #array #string #binary_search
Telegraph
maximize-active-section-with-trade-ii
给你一个长度为 n 的二进制字符串 s ,其中:
leetcode.com 2026-07-22
🔴3501.maximize-active-section-with-trade-ii
🏷️ Tags
#segment_tree #array #string #binary_search
🔴3501.maximize-active-section-with-trade-ii
🏷️ Tags
#segment_tree #array #string #binary_search
Telegraph
maximize-active-section-with-trade-ii
You are given a binary string s of length n, where:
leetcode.cn 2026-07-28
🟡3517.smallest-palindromic-rearrangement-i
🏷️ Tags
#string #counting_sort #sorting
🟡3517.smallest-palindromic-rearrangement-i
🏷️ Tags
#string #counting_sort #sorting
Telegraph
smallest-palindromic-rearrangement-i
给你一个 回文 字符串 s。 返回 s 的按字典序排列的 最小 回文排列。 如果一个字符串从前往后和从后往前读都相同,那么这个字符串是一个 回文 字符串。 排列 是字符串中所有字符的重排。
leetcode.com 2026-07-28
🟡3517.smallest-palindromic-rearrangement-i
🏷️ Tags
#string #counting_sort #sorting
🟡3517.smallest-palindromic-rearrangement-i
🏷️ Tags
#string #counting_sort #sorting
Telegraph
smallest-palindromic-rearrangement-i
You are given a palindromic string s. Return the lexicographically smallest palindromic permutation of s. Example 1: Input: s = "z" Output: "z" Explanation: A string of only one character is already the lexicographically smallest palindrome. Example 2:…
leetcode.cn 2026-07-29
🔴3518.smallest-palindromic-rearrangement-ii
🏷️ Tags
#hash_table #math #string #combinatorics #counting
🔴3518.smallest-palindromic-rearrangement-ii
🏷️ Tags
#hash_table #math #string #combinatorics #counting
Telegraph
smallest-palindromic-rearrangement-ii
给你一个 回文 字符串 s 和一个整数 k。
leetcode.com 2026-07-29
🔴3518.smallest-palindromic-rearrangement-ii
🏷️ Tags
#hash_table #math #string #combinatorics #counting
🔴3518.smallest-palindromic-rearrangement-ii
🏷️ Tags
#hash_table #math #string #combinatorics #counting
Telegraph
smallest-palindromic-rearrangement-ii
You are given a palindromic string s and an integer k. Return the k-th lexicographically smallest palindromic permutation of s. If there are fewer than k distinct palindromic permutations, return an empty string. Note: Different rearrangements that yield…
leetcode.cn 2026-07-31
🟡3016.minimum-number-of-pushes-to-type-word-ii
🏷️ Tags
#greedy #hash_table #string #counting #sorting
🟡3016.minimum-number-of-pushes-to-type-word-ii
🏷️ Tags
#greedy #hash_table #string #counting #sorting
Telegraph
minimum-number-of-pushes-to-type-word-ii
给你一个字符串 word,由小写英文字母组成。 电话键盘上的按键与 不同 小写英文字母集合相映射,可以通过按压按键来组成单词。例如,按键 2 对应 ["a","b","c"],我们需要按一次键来输入 "a",按两次键来输入 "b",按三次键来输入 "c"。 现在允许你将编号为 2 到 9 的按键重新映射到 不同 字母集合。每个按键可以映射到 任意数量 的字母,但每个字母 必须 恰好 映射到 一个 按键上。你需要找到输入字符串 word 所需的 最少 按键次数。 返回重新映射按键后输入 word 所需的 最少…
leetcode.com 2026-07-31
🟡3016.minimum-number-of-pushes-to-type-word-ii
🏷️ Tags
#greedy #hash_table #string #counting #sorting
🟡3016.minimum-number-of-pushes-to-type-word-ii
🏷️ Tags
#greedy #hash_table #string #counting #sorting
Telegraph
minimum-number-of-pushes-to-type-word-ii
You are given a string word containing lowercase English letters. Telephone keypads have keys mapped with distinct collections of lowercase English letters, which can be used to form words by pushing them. For example, the key 2 is mapped with ["a","b","c"]…
leetcode.cn 2026-08-07
🔴3348.smallest-divisible-digit-product-ii
🏷️ Tags
#greedy #math #string #backtracking #number_theory
🔴3348.smallest-divisible-digit-product-ii
🏷️ Tags
#greedy #math #string #backtracking #number_theory
Telegraph
smallest-divisible-digit-product-ii
给你一个字符串 num ,表示一个 正 整数,同时给你一个整数 t 。 如果一个整数 没有 任何数位是 0 ,那么我们称这个整数是 无零 数字。
leetcode.com 2026-08-07
🔴3348.smallest-divisible-digit-product-ii
🏷️ Tags
#greedy #math #string #backtracking #number_theory
🔴3348.smallest-divisible-digit-product-ii
🏷️ Tags
#greedy #math #string #backtracking #number_theory
Telegraph
smallest-divisible-digit-product-ii
You are given a string num which represents a positive integer, and an integer t. A number is called zero-free if none of its digits are 0. Return a string representing the smallest zero-free number greater than or equal to num such that the product of its…
leetcode.cn 2026-08-08
🟡3302.find-the-lexicographically-smallest-valid-sequence
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming
🟡3302.find-the-lexicographically-smallest-valid-sequence
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming
Telegraph
find-the-lexicographically-smallest-valid-sequence
给你两个字符串 word1 和 word2 。 如果一个字符串 x 修改 至多 一个字符会变成 y ,那么我们称它与 y 几乎相等 。 如果一个下标序列 seq 满足以下条件,我们称它是 合法的 :
leetcode.com 2026-08-08
🟡3302.find-the-lexicographically-smallest-valid-sequence
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming
🟡3302.find-the-lexicographically-smallest-valid-sequence
🏷️ Tags
#greedy #two_pointers #string #dynamic_programming
Telegraph
find-the-lexicographically-smallest-valid-sequence
You are given two strings word1 and word2. A string x is called almost equal to y if you can change at most one character in x to make it identical to y. A sequence of indices seq is called valid if:
leetcode.cn 2026-08-13
🔴2213.longest-substring-of-one-repeating-character
🏷️ Tags
#segment_tree #array #string #ordered_set
🔴2213.longest-substring-of-one-repeating-character
🏷️ Tags
#segment_tree #array #string #ordered_set
Telegraph
longest-substring-of-one-repeating-character
给你一个下标从 0 开始的字符串 s 。另给你一个下标从 0 开始、长度为 k 的字符串 queryCharacters ,一个下标从 0 开始、长度也是 k 的整数 下标 数组 queryIndices ,这两个都用来描述 k 个查询。 第 i 个查询会将 s 中位于下标 queryIndices[i] 的字符更新为 queryCharacters[i] 。 返回一个长度为 k 的数组 lengths ,其中 lengths[i] 是在执行第 i 个查询 之后 s 中仅由 单个字符重复 组成的 最长子字符串…
leetcode.com 2026-08-13
🔴2213.longest-substring-of-one-repeating-character
🏷️ Tags
#segment_tree #array #string #ordered_set
🔴2213.longest-substring-of-one-repeating-character
🏷️ Tags
#segment_tree #array #string #ordered_set
Telegraph
longest-substring-of-one-repeating-character
You are given a 0-indexed string s. You are also given a 0-indexed string queryCharacters of length k and a 0-indexed array of integer indices queryIndices of length k, both of which are used to describe k queries. The ith query updates the character in s…