摘要:
Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... For example, given nums = [3, 5, 2, 1, 6, 4], 阅读全文
posted @ 2016-09-24 17:42
Machelsky
阅读(132)
评论(0)
推荐(0)
摘要:
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, 阅读全文
posted @ 2016-09-24 11:14
Machelsky
阅读(143)
评论(0)
推荐(0)
摘要:
恢复内容开始 Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 思 阅读全文
posted @ 2016-09-24 10:26
Machelsky
阅读(109)
评论(0)
推荐(0)
摘要:
Given a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum. For example:Given the below binary tree and sum 阅读全文
posted @ 2016-09-24 06:17
Machelsky
阅读(202)
评论(0)
推荐(0)
摘要:
Given a binary tree, return all root-to-leaf paths. For example, given the following binary tree: All root-to-leaf paths are: Solution1: 用string是最方便的。 阅读全文
posted @ 2016-09-24 04:49
Machelsky
阅读(122)
评论(0)
推荐(0)
摘要:
Remove the minimum number of invalid parentheses in order to make the input string valid. Return all possible results. Note: The input string may cont 阅读全文
posted @ 2016-09-24 03:15
Machelsky
阅读(304)
评论(0)
推荐(0)
摘要:
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. For "(()", the lo 阅读全文
posted @ 2016-09-24 02:20
Machelsky
阅读(138)
评论(0)
推荐(0)
摘要:
Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文
posted @ 2016-09-24 01:45
Machelsky
阅读(123)
评论(0)
推荐(0)
浙公网安备 33010602011771号