LeetCode11:Container With Most Water
生活随笔
收集整理的這篇文章主要介紹了
LeetCode11:Container With Most Water
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
public int MaxArea(int[] height) {int start=0;int end=height.Length-1;int max=0;while(start<end){max=Math.Max(max,Math.Min(height[start],height[end])*(end-start));if(height[start]<height[end])start++;elseend--;}return max;}
?
轉載于:https://www.cnblogs.com/darksied/p/4783863.html
總結
以上是生活随笔為你收集整理的LeetCode11:Container With Most Water的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ACM中java的使用 (转)
- 下一篇: xpool, cpool,epoo