上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页
摘要: Given an unsorted array of integers, find the length of longest increasing subsequence.For example,Given[10, 9, 2, 5, 3, 7, 101, 18],The longest incre... 阅读全文
posted @ 2015-11-04 12:57 fenshen371 阅读(163) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i... 阅读全文
posted @ 2015-11-04 11:15 fenshen371 阅读(168) 评论(0) 推荐(0) 编辑
摘要: A message containing letters fromA-Zis being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an encoded message conta... 阅读全文
posted @ 2015-11-04 10:54 fenshen371 阅读(113) 评论(0) 推荐(0) 编辑
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest product.For example, given the array[2,3,-2,4],the... 阅读全文
posted @ 2015-11-04 09:47 fenshen371 阅读(147) 评论(0) 推荐(0) 编辑
摘要: Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest... 阅读全文
posted @ 2015-10-31 13:41 fenshen371 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given a collection of numbers, return all possible permutations.For example,[1,2,3]have the following permutations:[1,2,3],[1,3,2],[2,1,3],[2,3,1],[3,... 阅读全文
posted @ 2015-10-30 12:12 fenshen371 阅读(132) 评论(0) 推荐(0) 编辑
摘要: The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number... 阅读全文
posted @ 2015-10-30 12:00 fenshen371 阅读(133) 评论(0) 推荐(0) 编辑
摘要: Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))... 阅读全文
posted @ 2015-10-30 06:36 fenshen371 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e.,0 1 2 4 5 6 7might become4 5 6 7 0 1 2).Find the minimum element.You m... 阅读全文
posted @ 2015-10-29 06:09 fenshen371 阅读(124) 评论(0) 推荐(0) 编辑
摘要: Given an array where elements are sorted in ascending order, convert it to a height balanced BST.思路:分治。将当前区间的中点给当前node,然后左区间中点为left,右区间中点为right。以下为AC代... 阅读全文
posted @ 2015-10-29 05:33 fenshen371 阅读(145) 评论(0) 推荐(0) 编辑
上一页 1 ··· 7 8 9 10 11 12 13 14 15 ··· 18 下一页