摘要:
http://oj.leetcode.com/problems/container-with-most-water/从最外侧向内侧搜索, 在长度最长的情况下 保证高度尽量高. 注意如果左边第一个直线是所有直线里最长的情况.所以我采用左右各遍历一次的方法a了.然后看了题解发现自己好弱智. 还是贴自己的沙茶代码吧. 1 class Solution { 2 public: 3 int maxArea(vector &height) { 4 int re = 0; 5 int cur = 0; 6 int i = (int)height.siz... 阅读全文
posted @ 2014-01-03 22:53
NextLife
阅读(150)
评论(0)
推荐(0)
浙公网安备 33010602011771号