全站内容
todo
45. Jump Game II
#Problem You are given a 0-indexed array of integers nums of length n. You are initially positioned at nums[0]. Each element nums[i] represents the maximum length of a forward jump from index i. In other words, if you are at nums[i], you …
42. Trapping Rain Water
#Problem Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it can trap after raining. https://leetcode.com/problems/trapping-rain-water/ Example 1: case1Input: height = …
321. Create Maximum Number
#Problem You are given two integer arrays nums1 and nums2 of lengths m and n respectively. nums1 and nums2 represent the digits of two numbers. You are also given an integer k. Create the maximum number of length k <= m + n from digits of …
1719. Number Of Ways To Reconstruct A Tree
#Problem You are given an array pairs, where pairs[i] = [xᵢ, yᵢ], and: There are no duplicates. xᵢ < yᵢ Let ways be the number of rooted trees that satisfy the following conditions: The tree consists of nodes whose values appeared in pairs. …
2054. Two Best Non-Overlapping Events
#Problem You are given a 0-indexed 2D integer array of events where events[i] = [startTimeᵢ, endTimeᵢ, valueᵢ]. The iᵗʰ event starts at startTimeᵢ and ends at endTimeᵢ, and if you attend this event, you will receive a value of valueᵢ. You …
2097. Valid Arrangement of Pairs
#Problem You are given a 0-indexed 2D integer array pairs where pairs[i] = [startᵢ, endᵢ]. An arrangement of pairs is valid if for every index i where 1 <= i < pairs.length, we have endᵢ₋₁ == startᵢ. Return any valid arrangement of pairs. …