leetcode.cn 2026-06-25
🟡3737.count-subarrays-with-majority-element-i
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #counting #prefix_sum #merge_sort
🟡3737.count-subarrays-with-majority-element-i
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #counting #prefix_sum #merge_sort
Telegraph
count-subarrays-with-majority-element-i
给你一个整数数组 nums 和一个整数 target。
leetcode.com 2026-06-25
🟡3737.count-subarrays-with-majority-element-i
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #counting #prefix_sum #merge_sort
🟡3737.count-subarrays-with-majority-element-i
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #counting #prefix_sum #merge_sort
Telegraph
count-subarrays-with-majority-element-i
You are given an integer array nums and an integer target. Return the number of subarrays of nums in which target is the majority element. The majority element of a subarray is the element that appears strictly more than half of the times in that subarray.…
leetcode.cn 2026-06-26
🔴3739.count-subarrays-with-majority-element-ii
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #prefix_sum #merge_sort
🔴3739.count-subarrays-with-majority-element-ii
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #prefix_sum #merge_sort
Telegraph
count-subarrays-with-majority-element-ii
给你一个整数数组 nums 和一个整数 target。
leetcode.com 2026-06-26
🔴3739.count-subarrays-with-majority-element-ii
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #prefix_sum #merge_sort
🔴3739.count-subarrays-with-majority-element-ii
🏷️ Tags
#segment_tree #array #hash_table #divide_and_conquer #prefix_sum #merge_sort
Telegraph
count-subarrays-with-majority-element-ii
You are given an integer array nums and an integer target. Return the number of subarrays of nums in which target is the majority element. The majority element of a subarray is the element that appears strictly more than half of the times in that subarray.…
leetcode.cn 2026-06-27
🟡3020.find-the-maximum-number-of-elements-in-subset
🏷️ Tags
#array #hash_table #enumeration
🟡3020.find-the-maximum-number-of-elements-in-subset
🏷️ Tags
#array #hash_table #enumeration
Telegraph
find-the-maximum-number-of-elements-in-subset
给你一个 正整数 数组 nums 。 你需要从数组中选出一个满足下述条件的子集:
leetcode.com 2026-06-27
🟡3020.find-the-maximum-number-of-elements-in-subset
🏷️ Tags
#array #hash_table #enumeration
🟡3020.find-the-maximum-number-of-elements-in-subset
🏷️ Tags
#array #hash_table #enumeration
Telegraph
find-the-maximum-number-of-elements-in-subset
You are given an array of positive integers nums. You need to select a subset of nums which satisfies the following condition:
leetcode.cn 2026-06-28
🟡1846.maximum-element-after-decreasing-and-rearranging
🏷️ Tags
#greedy #array #sorting
🟡1846.maximum-element-after-decreasing-and-rearranging
🏷️ Tags
#greedy #array #sorting
Telegraph
maximum-element-after-decreasing-and-rearranging
给你一个正整数数组 arr 。请你对 arr 执行一些操作(也可以不进行任何操作),使得数组满足以下条件:
leetcode.com 2026-06-28
🟡1846.maximum-element-after-decreasing-and-rearranging
🏷️ Tags
#greedy #array #sorting
🟡1846.maximum-element-after-decreasing-and-rearranging
🏷️ Tags
#greedy #array #sorting
Telegraph
maximum-element-after-decreasing-and-rearranging
You are given an array of positive integers arr. Perform some operations (possibly none) on arr so that it satisfies these conditions:
leetcode.cn 2026-06-29
🟢1967.number-of-strings-that-appear-as-substrings-in-word
🏷️ Tags
#array #string
🟢1967.number-of-strings-that-appear-as-substrings-in-word
🏷️ Tags
#array #string
Telegraph
number-of-strings-that-appear-as-substrings-in-word
给你一个字符串数组 patterns 和一个字符串 word ,统计 patterns 中有多少个字符串是 word 的子字符串。返回字符串数目。 子字符串 是字符串中的一个连续字符序列。 示例 1: 输入:patterns = ["a","abc","bc","d"], word = "abc" 输出:3 解释: - "a" 是 "abc" 的子字符串。 - "abc" 是 "abc" 的子字符串。 - "bc" 是 "abc" 的子字符串。 - "d" 不是 "abc" 的子字符串。 patterns…
leetcode.com 2026-06-29
🟢1967.number-of-strings-that-appear-as-substrings-in-word
🏷️ Tags
#array #string
🟢1967.number-of-strings-that-appear-as-substrings-in-word
🏷️ Tags
#array #string
Telegraph
number-of-strings-that-appear-as-substrings-in-word
Given an array of strings patterns and a string word, return the number of strings in patterns that exist as a substring in word. A substring is a contiguous sequence of characters within a string. Example 1: Input: patterns = ["a","abc","bc","d"], word…
leetcode.cn 2026-07-01
🟡2812.find-the-safest-path-in-a-grid
🏷️ Tags
#breadth_first_search #union_find #array #binary_search #matrix #heap_priority_queue
🟡2812.find-the-safest-path-in-a-grid
🏷️ Tags
#breadth_first_search #union_find #array #binary_search #matrix #heap_priority_queue
Telegraph
find-the-safest-path-in-a-grid
给你一个下标从 0 开始、大小为 n x n 的二维矩阵 grid ,其中 (r, c) 表示:
leetcode.com 2026-07-01
🟡2812.find-the-safest-path-in-a-grid
🏷️ Tags
#breadth_first_search #union_find #array #binary_search #matrix #heap_priority_queue
🟡2812.find-the-safest-path-in-a-grid
🏷️ Tags
#breadth_first_search #union_find #array #binary_search #matrix #heap_priority_queue
Telegraph
find-the-safest-path-in-a-grid
You are given a 0-indexed 2D matrix grid of size n x n, where (r, c) represents:
leetcode.cn 2026-07-02
🟡3286.find-a-safe-walk-through-a-grid
🏷️ Tags
#breadth_first_search #graph #array #matrix #shortest_path #heap_priority_queue
🟡3286.find-a-safe-walk-through-a-grid
🏷️ Tags
#breadth_first_search #graph #array #matrix #shortest_path #heap_priority_queue
Telegraph
find-a-safe-walk-through-a-grid
给你一个 m x n 的二进制矩形 grid 和一个整数 health 表示你的健康值。 你开始于矩形的左上角 (0, 0) ,你的目标是矩形的右下角 (m - 1, n - 1) 。 你可以在矩形中往上下左右相邻格子移动,但前提是你的健康值始终是 正数 。 对于格子 (i, j) ,如果 grid[i][j] = 1 ,那么这个格子视为 不安全 的,会使你的健康值减少 1 。 如果你可以到达最终的格子,请你返回 true ,否则返回 false 。 注意 ,当你在最终格子的时候,你的健康值也必须为 正数 。…