上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 36 下一页
摘要: Find the contiguous subarray within an array (containing at least one number) which has the largest sum. For example, given the array [−2,1,−3,4,−1,2,... 阅读全文
posted @ 2014-11-27 04:37 LiBlog 阅读(145) 评论(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 @ 2014-11-27 02:03 LiBlog 阅读(148) 评论(0) 推荐(0) 编辑
摘要: Sort a linked list in O(n log n) time using constant space complexity.Analsys:We use Merge Sort.NOTE: We should practice other sort algorithm, linke Q... 阅读全文
posted @ 2014-11-27 01:03 LiBlog 阅读(170) 评论(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],t... 阅读全文
posted @ 2014-11-27 00:22 LiBlog 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Your algorithm sh... 阅读全文
posted @ 2014-11-26 23:14 LiBlog 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Follow up for N-Queens problem.Now, instead outputting board configurations, return the total number of distinct solutions.Solution:The same as N-Quee... 阅读全文
posted @ 2014-11-26 22:56 LiBlog 阅读(132) 评论(0) 推荐(0) 编辑
摘要: The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other.Given an integer n, return all d... 阅读全文
posted @ 2014-11-26 22:55 LiBlog 阅读(138) 评论(0) 推荐(0) 编辑
摘要: Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.Solution: 1 public class Solution { 2 pu... 阅读全文
posted @ 2014-11-26 12:00 LiBlog 阅读(140) 评论(0) 推荐(0) 编辑
摘要: Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is formed from th... 阅读全文
posted @ 2014-11-26 11:31 LiBlog 阅读(125) 评论(0) 推荐(0) 编辑
摘要: You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatena... 阅读全文
posted @ 2014-11-26 09:23 LiBlog 阅读(169) 评论(0) 推荐(0) 编辑
上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 36 下一页