Logo

分类:算法

3 篇文章

LeetCode-双指针10题结题思路-篇二

题目来源:https://books.halfrost.com/leetcode/ChapterTwo/Two_Pointers/31. 下一个排列题目链接:https://leetcode.cn/problems/next-permutation/先找末尾倒序的子串,然后将子串前一个字符和子串中,...

LeetCode-双指针10题结题思路-篇一

题目链接:https://leetcode.cn/problems/3sum/description/思路:排序,加双指针,两个循环注意点:边界条件,如果数组中数量少于3个,直接返回如果排序后第一个数字大于0,直接返回重复元素跳过,防止重复解...

11 Container With Most Water的数学证明

题目链接:https://leetcode.cn/problems/container-with-most-water/package leetcodefunc maxArea(height []int) int {max, start, end := 0, 0, len(height)-1for ...