摘要: Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1], retu... 阅读全文
posted @ 2016-11-30 14:34 copperface 阅读(257) 评论(0) 推荐(0) 编辑
摘要: Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find two ... 阅读全文
posted @ 2016-11-30 11:00 copperface 阅读(183) 评论(0) 推荐(0) 编辑