摘要:
Given an input string, reverse the string word by word. A word is defined as a sequence of non-space characters. The input string does not contain lea 阅读全文
摘要:
Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number. The function 阅读全文
摘要:
Description: Count the number of prime numbers less than a non-negative number, n. 埃拉托斯特尼筛法 阅读全文
摘要:
Given an array of integers A and let n to be its length. Assume Bk to be an array obtained by rotating the array A k positions clock-wise, we define a 阅读全文
摘要:
Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x. You should preserve the 阅读全文
摘要:
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. BST 阅读全文
摘要:
Given a singly linked list L: L0→L1→…→Ln-1→Ln,reorder it to: L0→Ln→L1→Ln-1→L2→Ln-2→… You must do this in-place without altering the nodes' values. For 阅读全文
摘要:
Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a 阅读全文