Avatar

Organizations

5 results for 单调栈
  • 给定 n个非负整数,用来表示柱状图中各个柱子的高度。每个柱子彼此相邻,且宽度为 1。

    求在该柱状图中,能够勾勒出来的矩形的最大面积。

    leetcode 困难 数组 单调栈 Created Wed, 21 Dec 2022 19:22:16 +0800
  • 给你一个整数数组 nums ,数组中共有 n 个整数。132 模式的子序列由三个整数 nums[i]nums[j]nums[k]组成,并同时满足:i < j < knums[i] < nums[k] < nums[j]

    如果 nums 中存在 132 模式的子序列 ,返回 true ;否则,返回false

    leetcode 中等 数组 二分查找 Created Wed, 21 Dec 2022 18:14:26 +0800
  • 给定一个仅包含  01 、大小为 rows x cols 的二维二进制矩阵,找出只包含 1 的最大矩形,并返回其面积。

    leetcode 困难 数组 动态规划 Created Tue, 13 Sep 2022 12:53:39 +0800
  • You are given an integer array nums. The range of a subarray of nums is the difference between the largest and smallest element in the subarray.

    Return the sum of all subarray ranges of nums.

    A subarray is a contiguous non-empty sequence of elements within an array.

    leetcode 中等 数组 单调栈 Created Fri, 04 Mar 2022 13:09:50 +0800
  • 你正在参加一个多角色游戏,每个角色都有两个主要属性:攻击防御 。给你一个二维整数数组 properties ,其中 \(properties[i] = [attack_i, defense_i]\) 表示游戏中第 i 个角色的属性。

    如果存在一个其他角色的攻击和防御等级 都严格高于 该角色的攻击和防御等级,则认为该角色为 弱角色 。更正式地,如果认为角色 i 弱于 存在的另一个角色 j ,那么 \(attack_j > attack_i\) 且 \(defense_j > defense_i\) 。

    返回 弱角色 的数量。

    leetcode 中等 贪心 数组 Created Fri, 28 Jan 2022 10:27:51 +0800