logo
publist
写文章

简介

该用户还未填写简介

擅长的技术栈

可提供的服务

暂无可提供的服务

leetcode C++ 42. 接雨水 给定 n 个非负整数表示每个宽度为 1 的柱子的高度图,计算按此排列的柱子,下雨之后能接多少雨水。 上面是由数组 [0,1,0,2,1,0,1,3,2,

一、思路:左边最高和右边最高求一个最小值减去当前高度,就等于当前能装的水的量二、代码:class Solution {public:int getMaxRight(vector<int>& height, int index) {int maxRight = 0;for (; index < height.size(); index...

#leetcode
到底了