leetcode.com 2025-03-08
🟢2379.minimum-recolors-to-get-k-consecutive-black-blocks
🏷️ Tags
#string #sliding_window
🟢2379.minimum-recolors-to-get-k-consecutive-black-blocks
🏷️ Tags
#string #sliding_window
Telegraph
minimum-recolors-to-get-k-consecutive-black-blocks
You are given a 0-indexed string blocks of length n, where blocks[i] is either 'W' or 'B', representing the color of the ith block. The characters 'W' and 'B' denote the colors white and black, respectively. You are also given an integer k, which is the desired…
leetcode.com 2025-03-10
🟡3306.count-of-substrings-containing-every-vowel-and-k-consonants-ii
🏷️ Tags
#hash_table #string #sliding_window
🟡3306.count-of-substrings-containing-every-vowel-and-k-consonants-ii
🏷️ Tags
#hash_table #string #sliding_window
Telegraph
count-of-substrings-containing-every-vowel-and-k-consonants-ii
You are given a string word and a non-negative integer k. Return the total number of substrings of word that contain every vowel ('a', 'e', 'i', 'o', and 'u') at least once and exactly k consonants. Example 1: Input: word = "aeioqq", k = 1 Output: 0 Explanation:…
👍1
leetcode.com 2025-03-11
🟡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 2025-03-12
🟡3305.count-of-substrings-containing-every-vowel-and-k-consonants-i
🏷️ Tags
#hash_table #string #sliding_window
🟡3305.count-of-substrings-containing-every-vowel-and-k-consonants-i
🏷️ Tags
#hash_table #string #sliding_window
Telegraph
count-of-substrings-containing-every-vowel-and-k-consonants-i
给你一个字符串 word 和一个 非负 整数 k。 返回 word 的 子字符串 中,每个元音字母('a'、'e'、'i'、'o'、'u')至少 出现一次,并且 恰好 包含 k 个辅音字母的子字符串的总数。 示例 1: 输入:word = "aeioqq", k = 1 输出:0 解释: 不存在包含所有元音字母的子字符串。 示例 2: 输入:word = "aeiou", k = 0 输出:1 解释: 唯一一个包含所有元音字母且不含辅音字母的子字符串是 word[0..4],即 "aeiou"。 示例…
leetcode.com 2025-03-12
🟢2529.maximum-count-of-positive-integer-and-negative-integer
🏷️ Tags
#array #binary_search #counting
🟢2529.maximum-count-of-positive-integer-and-negative-integer
🏷️ Tags
#array #binary_search #counting
Telegraph
maximum-count-of-positive-integer-and-negative-integer
Given an array nums sorted in non-decreasing order, return the maximum between the number of positive integers and the number of negative integers.
leetcode.cn 2025-03-13
🟡3306.count-of-substrings-containing-every-vowel-and-k-consonants-ii
🏷️ Tags
#hash_table #string #sliding_window
🟡3306.count-of-substrings-containing-every-vowel-and-k-consonants-ii
🏷️ Tags
#hash_table #string #sliding_window
Telegraph
count-of-substrings-containing-every-vowel-and-k-consonants-ii
给你一个字符串 word 和一个 非负 整数 k。
leetcode.cn 2025-03-17
🟡1963.minimum-number-of-swaps-to-make-the-string-balanced
🏷️ Tags
#stack #greedy #two_pointers #string
🟡1963.minimum-number-of-swaps-to-make-the-string-balanced
🏷️ Tags
#stack #greedy #two_pointers #string
Telegraph
minimum-number-of-swaps-to-make-the-string-balanced
给你一个字符串 s ,下标从 0 开始 ,且长度为偶数 n 。字符串 恰好 由 n / 2 个开括号 '[' 和 n / 2 个闭括号 ']' 组成。 只有能满足下述所有条件的字符串才能称为 平衡字符串 :
leetcode.com 2025-03-17
🟢2206.divide-array-into-equal-pairs
🏷️ Tags
#bit_manipulation #array #hash_table #counting
🟢2206.divide-array-into-equal-pairs
🏷️ Tags
#bit_manipulation #array #hash_table #counting
Telegraph
divide-array-into-equal-pairs
You are given an integer array nums consisting of 2 * n integers. You need to divide nums into n pairs such that: