Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l ...
分类:
其他好文 时间:
2019-03-04 09:31:18
阅读次数:
160
There are N piles of stones arranged in a row. The i-th pile has stones[i] stones. A move consists of merging exactly K consecutive piles into one pil ...
分类:
其他好文 时间:
2019-03-04 09:25:03
阅读次数:
149
Let's call any (contiguous) subarray B (of A) a mountain if the following properties hold: B.length >= 3 There exists some 0 < i < B.length - 1 such t ...
分类:
编程语言 时间:
2019-03-02 01:08:18
阅读次数:
221
一、数组 8) 双指针 滑动窗口 例题: 3. Longest Substring Without Repeating Characters 描述:Given a string, find the length of the longest substring without repeating c ...
分类:
其他好文 时间:
2019-02-24 19:04:19
阅读次数:
137
LCS--Longest Common Subsequence,即最长公共子序列,一般使用DP来解。 常规方法: dp[i][j]表示字符串s1前i个字符组成的字符串与s2前j个字符组成的字符串的LCS的长度,则当s1[i-1]==s2[j-1]时,dp[i][j]=dp[i-1][j-1],否则d ...
分类:
其他好文 时间:
2019-02-24 01:01:14
阅读次数:
194
题目: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique lo ...
分类:
其他好文 时间:
2019-02-18 18:58:53
阅读次数:
145
题目: Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique lo ...
分类:
其他好文 时间:
2019-02-18 18:52:07
阅读次数:
132
这是悦乐书的第 252 次更新,第 265 篇原创 01 看题和准备 今天介绍的是LeetCode算法题中Easy级别的第119题(顺位题号是521)。给定一组两个字符串,您需要找到这组两个字符串中最长的不同子序列。最长的不同子序列被定义为这些字符串之一的最长子序列,并且此子序列不应该是其他字符串的 ...
分类:
编程语言 时间:
2019-02-17 17:49:40
阅读次数:
161
"124. Longest Consecutive Sequence" / "128. Longest Consecutive Sequence" 本题难度: Medium/Hard Topic: Data Structure Description Given an unsorted array ...
分类:
其他好文 时间:
2019-02-17 15:31:49
阅读次数:
223