摘要:
题目如下: Consider the string s to be the infinite wraparound string of "abcdefghijklmnopqrstuvwxyz", so s will look like this: "...zabcdefghijklmnopqrstu 阅读全文
摘要:
题目如下: Given an array of unique integers, each integer is strictly greater than 1. We make a binary tree using these integers and each number may be us 阅读全文
摘要:
题目如下: Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You may not modify the values in the list's nodes, only nod 阅读全文
摘要:
题目如下: A conveyor belt has packages that must be shipped from one port to another within D days. The i-th package on the conveyor belt has a weight of 阅读全文
摘要:
题目如下: In a list of songs, the i-th song has a duration of time[i] seconds. Return the number of pairs of songs for which their total duration in secon 阅读全文
摘要:
题目如下: Every non-negative integer N has a binary representation. For example, 5 can be represented as "101" in binary, 11 as "1011" in binary, and so o 阅读全文
摘要:
题目如下: Given a non-empty binary tree, find the maximum path sum. For this problem, a path is defined as any sequence of nodes from some starting node t 阅读全文
摘要:
题目如下: Sort a linked list in O(n log n) time using constant space complexity. Example 1: Example 2: 解题思路:因为题目要求时间复杂度是O(nlogn),所以快排应该是合适的方法。原理也和快速排序差不多, 阅读全文
摘要:
题目如下: Given a list of directory info including directory path, and all the files with contents in this directory, you need to find out all the groups 阅读全文
摘要:
题目如下: Return the root node of a binary search tree that matches the given preorder traversal. (Recall that a binary search tree is a binary tree where 阅读全文