leetcode.cn 2026-08-11
🟢2996.smallest-missing-integer-greater-than-sequential-prefix-sum
🏷️ Tags
#array #hash_table #sorting
🟢2996.smallest-missing-integer-greater-than-sequential-prefix-sum
🏷️ Tags
#array #hash_table #sorting
Telegraph
smallest-missing-integer-greater-than-sequential-prefix-sum
给你一个下标从 0 开始的整数数组 nums 。 如果一个前缀 nums[0..i] 满足对于 1 <= j <= i 的所有元素都有 nums[j] = nums[j - 1] + 1 ,那么我们称这个前缀是一个 顺序前缀 。特殊情况是,只包含 nums[0] 的前缀也是一个 顺序前缀 。 请你返回 nums 中没有出现过的 最小 整数 x ,满足 x 大于等于 最长 顺序前缀的和。 示例 1: 输入:nums = [1,2,3,2,5] 输出:6 解释:nums 的最长顺序前缀是 [1,2,3]…
leetcode.com 2026-08-11
🟢2996.smallest-missing-integer-greater-than-sequential-prefix-sum
🏷️ Tags
#array #hash_table #sorting
🟢2996.smallest-missing-integer-greater-than-sequential-prefix-sum
🏷️ Tags
#array #hash_table #sorting
Telegraph
smallest-missing-integer-greater-than-sequential-prefix-sum
You are given a 0-indexed array of integers nums. A prefix nums[0..i] is sequential if, for all 1 <= j <= i, nums[j] = nums[j - 1] + 1. In particular, the prefix consisting only of nums[0] is sequential. Return the smallest integer x missing from nums such…
leetcode.cn 2026-08-12
🟡2958.length-of-longest-subarray-with-at-most-k-frequency
🏷️ Tags
#array #hash_table #sliding_window
🟡2958.length-of-longest-subarray-with-at-most-k-frequency
🏷️ Tags
#array #hash_table #sliding_window
Telegraph
length-of-longest-subarray-with-at-most-k-frequency
给你一个整数数组 nums 和一个整数 k 。 一个元素 x 在数组中的 频率 指的是它在数组中的出现次数。 如果一个数组中所有元素的频率都 小于等于 k ,那么我们称这个数组是 好 数组。 请你返回 nums 中 最长好 子数组的长度。 子数组 指的是一个数组中一段连续非空的元素序列。 示例 1: 输入:nums = [1,2,3,1,2,3,1,2], k = 2 输出:6 解释:最长好子数组是 [1,2,3,1,2,3] ,值 1 ,2 和 3 在子数组中的频率都没有超过 k = 2 。[2,3…
leetcode.com 2026-08-12
🟡2958.length-of-longest-subarray-with-at-most-k-frequency
🏷️ Tags
#array #hash_table #sliding_window
🟡2958.length-of-longest-subarray-with-at-most-k-frequency
🏷️ Tags
#array #hash_table #sliding_window
Telegraph
length-of-longest-subarray-with-at-most-k-frequency
You are given an integer array nums and an integer k. The frequency of an element x is the number of times it occurs in an array. An array is called good if the frequency of each element in this array is less than or equal to k. Return the length of the longest…
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…
leetcode.cn 2026-08-14
🟢3090.maximum-length-substring-with-two-occurrences
🏷️ Tags
#hash_table #string #sliding_window
🟢3090.maximum-length-substring-with-two-occurrences
🏷️ Tags
#hash_table #string #sliding_window
Telegraph
maximum-length-substring-with-two-occurrences
给你一个字符串 s ,请找出满足每个字符最多出现两次的最长子字符串,并返回该子字符串的 最大 长度。 示例 1: 输入: s = "bcbbbcba" 输出: 4 解释: 以下子字符串长度为 4,并且每个字符最多出现两次:"bcbbbcba"。 示例 2: 输入: s = "aaaa" 输出: 2 解释: 以下子字符串长度为 2,并且每个字符最多出现两次:"aaaa"。 提示:
leetcode.com 2026-08-14
🟢3090.maximum-length-substring-with-two-occurrences
🏷️ Tags
#hash_table #string #sliding_window
🟢3090.maximum-length-substring-with-two-occurrences
🏷️ Tags
#hash_table #string #sliding_window
Telegraph
maximum-length-substring-with-two-occurrences
Example 1: Input: s = "bcbbbcba" Output: 4 Explanation:
leetcode.cn 2026-08-15
🟡3702.longest-subsequence-with-non-zero-bitwise-xor
🏷️ Tags
#bit_manipulation #array
🟡3702.longest-subsequence-with-non-zero-bitwise-xor
🏷️ Tags
#bit_manipulation #array
Telegraph
longest-subsequence-with-non-zero-bitwise-xor
给你一个整数数组 nums。