题目
Hoven_小明
瓜大在读本科生
展开
-
Leetcode 18. 四数之和
Leetcode 18. 四数之和 文章目录Leetcode 18. 四数之和题目解法思路一:暴力法代码思路二:双指针代码思路三:哈希表思路四:递归代码 题目 给定一个包含 n 个整数的数组 nums 和一个目标值 target,判断 nums 中是否存在四个元素 a,b,c 和 d ,使得 a + b + c + d 的值与 target 相等?找出所有满足条件且不重复的四元组。 注意: 答案中...转载 2019-06-12 20:08:43 · 380 阅读 · 0 评论 -
Leetcode 783. 二叉搜索树结点最小距离
Leetcode 783. 二叉搜索树结点最小距离 文章目录Leetcode 783. 二叉搜索树结点最小距离题目思路代码 题目 给定一个二叉搜索树的根结点 root, 返回树中任意两节点的差的最小值。 示例: 输入: root = [4,2,6,1,3,null,null] 输出: 1 解释: 注意,root是树结点对象(TreeNode object),而不是数组。 给定的树 [4,2,6,1...转载 2019-06-12 19:35:36 · 202 阅读 · 0 评论 -
Leetcode 996. Number of Squareful Arrays
996. Number of Squareful Arrays 文章目录996. Number of Squareful ArraysOriginal ProblemChinese TranslationOfficial SolutionsBacktrackBrief IdeaAlgorithmJAVA SolutionPython SolutionAnalysisDynamicBrief Id...转载 2019-05-21 19:38:58 · 203 阅读 · 0 评论 -
Leetcode 765. Couples Holding Hands
765. Couples Holding HandsBrief DescriptionTranslation(by Google)c++ SolutionJAVA SolutionQuote and Problem Hyperlinked Brief Description II – N couples problem The N couples problem can be solved usi...转载 2019-05-21 09:21:09 · 200 阅读 · 0 评论