leetcode.com 2023-07-02
🔴1601.maximum-number-of-achievable-transfer-requests
🏷️ Tags
#bit_manipulation #array #backtracking #enumeration
🔴1601.maximum-number-of-achievable-transfer-requests
🏷️ Tags
#bit_manipulation #array #backtracking #enumeration
Telegraph
maximum-number-of-achievable-transfer-requests
We have n buildings numbered from 0 to n - 1. Each building has a number of employees. It's transfer season, and some employees want to change the building they reside in. You are given an array requests where requests[i] = [fromi, toi] represents an employee's…
leetcode.cn 2023-07-04
🟡2679.sum-in-a-matrix
🏷️ Tags
#array #matrix #sorting #simulation #heap_priority_queue
🟡2679.sum-in-a-matrix
🏷️ Tags
#array #matrix #sorting #simulation #heap_priority_queue
Telegraph
sum-in-a-matrix
给你一个下标从 0 开始的二维整数数组 nums 。一开始你的分数为 0 。你需要执行以下操作直到矩阵变为空:
leetcode.com 2023-07-05
🟡1493.longest-subarray-of-1s-after-deleting-one-element
🏷️ Tags
#array #dynamic_programming #sliding_window
🟡1493.longest-subarray-of-1s-after-deleting-one-element
🏷️ Tags
#array #dynamic_programming #sliding_window
Telegraph
longest-subarray-of-1s-after-deleting-one-element
Given a binary array nums, you should delete one element from it. Return the size of the longest non-empty subarray containing only 1's in the resulting array. Return 0 if there is no such subarray. Example 1: Input: nums = [1,1,0,1] Output: 3 Explanation:…
leetcode.cn 2023-07-06
🟡2178.maximum-split-of-positive-even-integers
🏷️ Tags
#greedy #math #backtracking
🟡2178.maximum-split-of-positive-even-integers
🏷️ Tags
#greedy #math #backtracking
Telegraph
maximum-split-of-positive-even-integers
给你一个整数 finalSum 。请你将它拆分成若干个 互不相同 的正偶数之和,且拆分出来的正偶数数目 最多 。
leetcode.com 2023-07-06
🟡209.minimum-size-subarray-sum
🏷️ Tags
#array #binary_search #prefix_sum #sliding_window
🟡209.minimum-size-subarray-sum
🏷️ Tags
#array #binary_search #prefix_sum #sliding_window
Telegraph
minimum-size-subarray-sum
Given an array of positive integers nums and a positive integer target, return the minimal length of a subarray whose sum is greater than or equal to target. If there is no such subarray, return 0 instead. Example 1: Input: target = 7, nums = [2,3,1,2,4…
leetcode.com 2023-07-07
🟡2024.maximize-the-confusion-of-an-exam
🏷️ Tags
#string #binary_search #prefix_sum #sliding_window
🟡2024.maximize-the-confusion-of-an-exam
🏷️ Tags
#string #binary_search #prefix_sum #sliding_window
Telegraph
maximize-the-confusion-of-an-exam
A teacher is writing a test with n true/false questions, with 'T' denoting true and 'F' denoting false. He wants to confuse the students by maximizing the number of consecutive questions with the same answer (multiple trues or multiple falses in a row). You…
leetcode.cn 2023-07-08
🟡167.two-sum-ii-input-array-is-sorted
🏷️ Tags
#array #two_pointers #binary_search
🟡167.two-sum-ii-input-array-is-sorted
🏷️ Tags
#array #two_pointers #binary_search
Telegraph
two-sum-ii-input-array-is-sorted
给你一个下标从 1 开始的整数数组 numbers ,该数组已按 非递减顺序排列 ,请你从数组中找出满足相加之和等于目标数 target 的两个数。如果设这两个数分别是 numbers[index1] 和 numbers[index2] ,则 1 <= index1 < index2 <= numbers.length 。 以长度为 2 的整数数组 [index1, index2] 的形式返回这两个整数的下标 index1 和 index2。 你可以假设每个输入 只对应唯一的答案 ,而且你 不可以 重复使用相同的元素。…
leetcode.com 2023-07-10
🟢111.minimum-depth-of-binary-tree
🏷️ Tags
#tree #depth_first_search #breadth_first_search #binary_tree
🟢111.minimum-depth-of-binary-tree
🏷️ Tags
#tree #depth_first_search #breadth_first_search #binary_tree
Telegraph
minimum-depth-of-binary-tree
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest leaf node. Note: A leaf is a node with no children. Example 1: Input: root = [3,9,20,null,null,15,7] Output:…
leetcode.com 2023-07-11
🟡863.all-nodes-distance-k-in-binary-tree
🏷️ Tags
#tree #depth_first_search #breadth_first_search #binary_tree
🟡863.all-nodes-distance-k-in-binary-tree
🏷️ Tags
#tree #depth_first_search #breadth_first_search #binary_tree
Telegraph
all-nodes-distance-k-in-binary-tree
Given the root of a binary tree, the value of a target node target, and an integer k, return an array of the values of all nodes that have a distance k from the target node. You can return the answer in any order. Example 1: Input: root = [3,5,1,6,2,0,8…