pointer
feeeeeeet
这个作者很懒,什么都没留下…
展开
-
Leetcode 11. Container With Most Water
Two Pointer Algorithm & Proof class Solution { public int maxArea(int[] height) { int left=0; int right=height.length-1; int sum=0; while(left<right){ ...原创 2018-11-13 06:02:36 · 137 阅读 · 0 评论 -
Leetcode 15. 3Sum
Iterate every unduplicated element in nums. In every iteration, use two pointers to find another two numbers from both sides to center. First version gives a wrong answer for the following case: In...原创 2018-11-14 05:23:29 · 61 阅读 · 0 评论