leetcode.cn 2025-09-26
🟡611.valid-triangle-number
🏷️ Tags
#greedy #array #two_pointers #binary_search #sorting
🟡611.valid-triangle-number
🏷️ Tags
#greedy #array #two_pointers #binary_search #sorting
Telegraph
valid-triangle-number
给定一个包含非负整数的数组 nums ,返回其中可以组成三角形三条边的三元组个数。 示例 1: 输入: nums = [2,2,3,4] 输出: 3 解释:有效的组合是: 2,3,4 (使用第一个 2) 2,3,4 (使用第二个 2) 2,2,3 示例 2: 输入: nums = [4,2,3,4] 输出: 4 提示:
leetcode.com 2025-09-26
🟡611.valid-triangle-number
🏷️ Tags
#greedy #array #two_pointers #binary_search #sorting
🟡611.valid-triangle-number
🏷️ Tags
#greedy #array #two_pointers #binary_search #sorting
Telegraph
valid-triangle-number
Given an integer array nums, return the number of triplets chosen from the array that can make triangles if we take them as side lengths of a triangle. Example 1: Input: nums = [2,2,3,4] Output: 3 Explanation: Valid combinations are: 2,3,4 (using the first…
leetcode.com 2025-09-29
🟡1039.minimum-score-triangulation-of-polygon
🏷️ Tags
#array #dynamic_programming
🟡1039.minimum-score-triangulation-of-polygon
🏷️ Tags
#array #dynamic_programming
Telegraph
minimum-score-triangulation-of-polygon
You have a convex n-sided polygon where each vertex has an integer value. You are given an integer array values where values[i] is the value of the ith vertex in clockwise order. Polygon triangulation is a process where you divide a polygon into a set of…
leetcode.cn 2025-09-30
🟡2221.find-triangular-sum-of-an-array
🏷️ Tags
#array #math #combinatorics #simulation
🟡2221.find-triangular-sum-of-an-array
🏷️ Tags
#array #math #combinatorics #simulation
Telegraph
find-triangular-sum-of-an-array
给你一个下标从 0 开始的整数数组 nums ,其中 nums[i] 是 0 到 9 之间(两者都包含)的一个数字。 nums 的 三角和 是执行以下操作以后最后剩下元素的值:
leetcode.com 2025-09-30
🟡2221.find-triangular-sum-of-an-array
🏷️ Tags
#array #math #combinatorics #simulation
🟡2221.find-triangular-sum-of-an-array
🏷️ Tags
#array #math #combinatorics #simulation
Telegraph
find-triangular-sum-of-an-array
You are given a 0-indexed integer array nums, where nums[i] is a digit between 0 and 9 (inclusive). The triangular sum of nums is the value of the only element present in nums after the following process terminates:
leetcode.cn 2025-10-03
🔴407.trapping-rain-water-ii
🏷️ Tags
#breadth_first_search #array #matrix #heap_priority_queue
🔴407.trapping-rain-water-ii
🏷️ Tags
#breadth_first_search #array #matrix #heap_priority_queue
Telegraph
trapping-rain-water-ii
给你一个 m x n 的矩阵,其中的值均为非负整数,代表二维高度图每个单元的高度,请计算图中形状最多能接多少体积的雨水。 示例 1: 输入: heightMap = [[1,4,3,1,3,2],[3,2,1,3,2,4],[2,3,3,2,3,1]] 输出: 4 解释: 下雨后,雨水将会被上图蓝色的方块中。总的接雨水量为1+2+1=4。 示例 2: 输入: heightMap = [[3,3,3,3,3],[3,2,2,2,3],[3,2,1,2,3],[3,2,2,2,3],[3,3,3,3,3]]…
leetcode.com 2025-10-03
🔴407.trapping-rain-water-ii
🏷️ Tags
#breadth_first_search #array #matrix #heap_priority_queue
🔴407.trapping-rain-water-ii
🏷️ Tags
#breadth_first_search #array #matrix #heap_priority_queue
Telegraph
trapping-rain-water-ii
Given an m x n integer matrix heightMap representing the height of each unit cell in a 2D elevation map, return the volume of water it can trap after raining. Example 1: Input: heightMap = [[1,4,3,1,3,2],[3,2,1,3,2,4],[2,3,3,2,3,1]] Output: 4 Explanation:…
leetcode.cn 2025-10-05
🟡417.pacific-atlantic-water-flow
🏷️ Tags
#depth_first_search #breadth_first_search #array #matrix
🟡417.pacific-atlantic-water-flow
🏷️ Tags
#depth_first_search #breadth_first_search #array #matrix
Telegraph
pacific-atlantic-water-flow
有一个 m × n 的矩形岛屿,与 太平洋 和 大西洋 相邻。 “太平洋” 处于大陆的左边界和上边界,而 “大西洋” 处于大陆的右边界和下边界。 这个岛被分割成一个由若干方形单元格组成的网格。给定一个 m x n 的整数矩阵 heights , heights[r][c] 表示坐标 (r, c) 上单元格 高于海平面的高度 。 岛上雨水较多,如果相邻单元格的高度 小于或等于 当前单元格的高度,雨水可以直接向北、南、东、西流向相邻单元格。水可以从海洋附近的任何单元格流入海洋。 返回网格坐标 result 的…