题目: Given a linked list, return the node where the cycle begins. If there is no cycle, return null. Follo…
分类:LeetCode
[Leetcode] Maximum Subarray 子序列最大和
Maximum Subarray 最新更新请见:https://yanjia.me/zh/2019/02/… Find the contiguous subarray within an array (con…
力扣(LeetCode)113
题目地址:https://leetcode-cn.com/probl…题目描述:给定一个二叉树和一个目标和,找到所有从根节点到叶子节点路径总和等于给定目标和的路径。 说明: 叶子节点是指没有子节点的节点。 示…
High Five解题报告
Description: There are two properties in the node student id and scores, to ensure that each student will have…
LeetCode | 3Sum Closest(找到三个数使其和与target最接近)
Given an array S of n integers, find three integers in S such that the sum is cl…
LeetCode | 3Sum(三个数的和等于0)
Given an array S of n integers, are there elements a, b, c in S&n…
LeetCode算法题-Majority Element(Java实现)
这是悦乐书的第181次更新,第183篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第40题(顺位题号是169)。给定大小为n的数组,找到数组中出现次数超过n/2的元素。假设该数组非空,并且该…
1. Stack
什么情况使用栈? 利用栈的后进先出性质。 输入:数组,输出:与数组下标和元素都相关。而且栈中构成一定的顺序比如递增、递减,如果不满足则出栈进行计算。 需要注意的情况 搞清楚什么时候需要入栈、出栈 搞清楚栈中应该放元素or…
[LeetCode By Go 31]453. Minimum Moves to Equal Array Elements
题目 Given a non-empty integer array of size n, find the minimum number of moves required to make all array elem…
[Leetcode] Shortest Word Distance 最短单词间距
Shortest Word Distance Given a list of words and two words word1 and word2, return the shortest distance betwe…
[Leetcode] Permutations 全排列
Permutations I Given a collection of numbers, return all possible permutations. For example, [1,2,3] have the …
【leetcode】45. Jump Game II 非负数组的最少跳跃步数
1. 题目 Given an array of non-negative integers, you are initially positioned at the first index of the array. E…