上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页
摘要: Given a non-empty array of integers, return the k most frequent elements. For example,Given [1,1,1,2,2,3] and k = 2, return [1,2]. Note: You may assum 阅读全文
posted @ 2016-09-25 06:23 Machelsky 阅读(259) 评论(0) 推荐(0)
摘要: 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 阅读(130) 评论(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 阅读(142) 评论(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 阅读(107) 评论(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 阅读(199) 评论(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 阅读(120) 评论(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 阅读(301) 评论(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 阅读(134) 评论(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 阅读(120) 评论(0) 推荐(0)
摘要: Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree. According to the definition of LCA on Wikipedia: “The lowes 阅读全文
posted @ 2016-09-23 13:50 Machelsky 阅读(104) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 15 下一页