Sort List 描述 分析 代码 相关题目 Sort List 描述 Sort a linked list in O(n log n) time using constant space complexity. 分析 常数空间且O(nlogn) ,单链表适合用归并排序,双向链表适合用快速排序。本题可以复用 Merge Two ...
Distinct Subsequences 描述 分析 代码 Distinct Subsequences 描述 Given a string S and a string T , count the number of distinct subsequences of T in S . A subsequence of a strin...
Best Time to Buy and Sell Stock 描述 分析 代码 相关题目 Best Time to Buy and Sell Stock 描述 Say you have an array for which the i-th element is the price of a given stock on day i. ...
Gas Station 描述 分析 代码 Gas Station 描述 There are N gas stations along a circular route, where the amount of gas at station i is gas[i] . You have a car with an unlimited g...
Additive Number 描述 分析 代码 Additive Number 描述 Additive number is a string whose digits can form additive sequence. A valid additive sequence should contain at least three ...