接雨水

2024/9/25 10:34:10

Leetcode42. 接雨水

讲的好的视频讲解 【很难想象这up刷题的精神状态 Leetcode42. 接雨水】 https://www.bilibili.com/video/BV1MC411n7Af/?share_sourcecopy_web&vd_sourceafbacdc02063c57e7a2ef256a4db9d2a rm是right max的意思,lm是left max的意思 时间复杂度: O (…

算法练习第六十天|84. 柱状图中最大的矩形

84. 柱状图中最大的矩形 柱状图中最大的矩形 class Solution {public int largestRectangleArea(int[] heights) {int[] newHeight new int[heights.length 2];System.arraycopy(heights, 0, newHeight, 1, heights.length);newHeight[heights.length1] 0;newHeight[0] 0;…

算法练习第六十天|84. 柱状图中最大的矩形

84. 柱状图中最大的矩形 柱状图中最大的矩形 class Solution {public int largestRectangleArea(int[] heights) {int[] newHeight new int[heights.length 2];System.arraycopy(heights, 0, newHeight, 1, heights.length);newHeight[heights.length1] 0;newHeight[0] 0;…