[LeetCode] Valid Square 验证正方形

 Given the coordinates of four points in 2D space, return whether the four points could construct a square.The coordinate (x,y) of a point is rep
4次阅读

[LeetCode] Longest Line of Consecutive One in Matrix 矩阵中最长的连续1

 Given a 01 matrix M, find the longest line of consecutive one in the matrix. The line could be horizontal, vertical, diagonal or anti-diago
6次阅读

[LeetCode] Longest Harmonious Subsequence 最长和谐子序列

 We define a harmonious array is an array where the difference between its maximum value and its minimum value is exactly 1.Now, given
4次阅读

[LeetCode] Split Concatenated Strings 分割串联字符串

 Given a list of strings, you could concatenate these strings together into a loop, where for each string you could choose to reverse it or not.
7次阅读

[LeetCode] Optimal Division 最优分隔

 Given a list of positive integers, the adjacent integers will perform the float division. For example, [2,3,4] -> 2 / 3 / 4.However, you
8次阅读

[LeetCode] Shortest Unsorted Continuous Subarray 最短无序连续子数组

 Given an integer array, you need to find one continuous subarray that if you only sort this subarray in ascending order, then the whol
6次阅读

[LeetCode] Student Attendance Record II 学生出勤记录之二

 Given a positive integer n, return the number of all possible attendance records with length n, which will be regarded as rewardable. The answer
36次阅读

[LeetCode] Binary Tree Longest Consecutive Sequence II 二叉树最长连续序列之二

 Given a binary tree, you need to find the length of Longest Consecutive Path in Binary Tree.Especially, this path can be either increasing or de
27次阅读

LeetCode Binary Search Summary 二分搜索法小结

 二分查找法作为一种常见的查找方法,将原本是线性时间提升到了对数时间范围,大大缩短了搜索时间,具有很大的应用场景,而在LeetCode中,要运用二分搜索法来解的题目也有很多,但是实际上二分查找法的查找目标有很多种,而且在细节写法也有一些变化。之前有网友留言希望博主能针对二分查找法的具体写法
4次阅读

[LeetCode] Split Array with Equal Sum 分割数组成和相同的子数组

 Given an array with n integers, you need to find if there are triplets (i, j, k) which satisfies following conditions:0 < i, i + 1 < j, j
8次阅读