leetcode.com 2025-02-25
🟡1524.number-of-sub-arrays-with-odd-sum
🏷️ Tags
#array #math #dynamic_programming #prefix_sum
🟡1524.number-of-sub-arrays-with-odd-sum
🏷️ Tags
#array #math #dynamic_programming #prefix_sum
Telegraph
number-of-sub-arrays-with-odd-sum
Given an array of integers arr, return the number of subarrays with an odd sum. Since the answer can be very large, return it modulo 109 + 7. Example 1: Input: arr = [1,3,5] Output: 4 Explanation: All subarrays are [[1],[1,3],[1,3,5],[3],[3,5],[5]] All…
leetcode.cn 2025-02-27
🔴2296.design-a-text-editor
🏷️ Tags
#stack #design #linked_list #string #doubly_linked_list #simulation
🔴2296.design-a-text-editor
🏷️ Tags
#stack #design #linked_list #string #doubly_linked_list #simulation
Telegraph
design-a-text-editor
请你设计一个带光标的文本编辑器,它可以实现以下功能:
leetcode.com 2025-02-27
🟡873.length-of-longest-fibonacci-subsequence
🏷️ Tags
#array #hash_table #dynamic_programming
🟡873.length-of-longest-fibonacci-subsequence
🏷️ Tags
#array #hash_table #dynamic_programming
Telegraph
length-of-longest-fibonacci-subsequence
A sequence x1, x2, ..., xn is Fibonacci-like if:
leetcode.cn 2025-02-28
🟡2353.design-a-food-rating-system
🏷️ Tags
#design #array #hash_table #string #ordered_set #heap_priority_queue
🟡2353.design-a-food-rating-system
🏷️ Tags
#design #array #hash_table #string #ordered_set #heap_priority_queue
Telegraph
design-a-food-rating-system
设计一个支持下述操作的食物评分系统:
leetcode.com 2025-03-02
🟢2570.merge-two-2d-arrays-by-summing-values
🏷️ Tags
#array #hash_table #two_pointers
🟢2570.merge-two-2d-arrays-by-summing-values
🏷️ Tags
#array #hash_table #two_pointers
Telegraph
merge-two-2d-arrays-by-summing-values
You are given two 2D integer arrays nums1 and nums2.
leetcode.com 2025-03-03
🟡2161.partition-array-according-to-given-pivot
🏷️ Tags
#array #two_pointers #simulation
🟡2161.partition-array-according-to-given-pivot
🏷️ Tags
#array #two_pointers #simulation
Telegraph
partition-array-according-to-given-pivot
You are given a 0-indexed integer array nums and an integer pivot. Rearrange nums such that the following conditions are satisfied:
leetcode.cn 2025-03-06
🟡2588.count-the-number-of-beautiful-subarrays
🏷️ Tags
#bit_manipulation #array #hash_table #prefix_sum
🟡2588.count-the-number-of-beautiful-subarrays
🏷️ Tags
#bit_manipulation #array #hash_table #prefix_sum
Telegraph
count-the-number-of-beautiful-subarrays
给你一个下标从 0 开始的整数数组nums 。每次操作中,你可以:
leetcode.com 2025-03-06
🟢2965.find-missing-and-repeated-values
🏷️ Tags
#array #hash_table #math #matrix
🟢2965.find-missing-and-repeated-values
🏷️ Tags
#array #hash_table #math #matrix
Telegraph
find-missing-and-repeated-values
You are given a 0-indexed 2D integer matrix grid of size n * n with values in the range [1, n2]. Each integer appears exactly once except a which appears twice and b which is missing. The task is to find the repeating and missing numbers a and b. Return a…
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]…