摘要:
Description A subsequence of a given sequence is the given sequence with some elements (possible none) left out. Given a sequence X = < x1, x2, ..., x 阅读全文
摘要:
Description Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Sample 思路 回文串是正着读、反着读都 阅读全文
摘要:
Description Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 实现链表版的 k 路归并并分析其复杂度。 思路 一看到归并且要求时间复杂度尽可 阅读全文
摘要:
Description Find the contiguous subarray within an array (containing at least one number) which has the largest sum. Input [-2,1,-3,4,-1,2,1,-5,4] Out 阅读全文
摘要:
Description Mr. and Mrs. Smith are going to the seaside for their holiday. Before they start off, they need to choose a hotel. They got a list of hote 阅读全文
摘要:
Description We all love recursion! Don't we? Consider a three-parameter recursive function w(a, b, c): if a <= 0 or b <= 0 or c <= 0, then w(a, b, c) 阅读全文