双指针
2022-02-17 本文已影响0人
外腾湖南
5. Longest Palindromic Substring
这种判断题用双指针比较好;
42. Trapping Rain Water
这题不用双指针很难做;
要用while loop,然后不断去累加;
while(left<=right)
res += l_max-height[left];
res += r_max-height[right]
5. Longest Palindromic Substring
这种判断题用双指针比较好;
42. Trapping Rain Water
这题不用双指针很难做;
要用while loop,然后不断去累加;
while(left<=right)
res += l_max-height[left];
res += r_max-height[right]