上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 21 下一页

2016年7月4日

Implement Trie (Prefix Tree)

摘要: Implement a trie with insert, search, and startsWith methods. Note: You may assume that all inputs are consist of lowercase letters a-z. 终于进军trie树,tri 阅读全文

posted @ 2016-07-04 10:11 Sheryl Wang 阅读(167) 评论(0) 推荐(0) 编辑

2016年7月3日

Graph Valid Tree

摘要: Given n nodes labeled from 0 to n - 1 and a list of undirected edges (each edge is a pair of nodes), write a function to check whether these edges mak 阅读全文

posted @ 2016-07-03 22:21 Sheryl Wang 阅读(236) 评论(0) 推荐(0) 编辑

2016年7月2日

Maximum Subarray III

摘要: Given an array of integers and a number k, find k non-overlapping subarrays which have the largest sum. The number in each subarray should be contiguo 阅读全文

posted @ 2016-07-02 17:00 Sheryl Wang 阅读(271) 评论(0) 推荐(0) 编辑

Maximum Subarray II

摘要: Given an array of integers, find two non-overlapping subarrays which have the largest sum. The number in each subarray should be contiguous. Return th 阅读全文

posted @ 2016-07-02 16:51 Sheryl Wang 阅读(123) 评论(0) 推荐(0) 编辑

2016年6月29日

Maximum Subarray

摘要: 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 @ 2016-06-29 20:35 Sheryl Wang 阅读(246) 评论(0) 推荐(0) 编辑

Minimum Adjustment Cost

摘要: Given an integer array, adjust each integers so that the difference of every adjacent integers are not greater than a given number target. If the arra 阅读全文

posted @ 2016-06-29 17:56 Sheryl Wang 阅读(106) 评论(0) 推荐(0) 编辑

4Sum

摘要: Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array whic 阅读全文

posted @ 2016-06-29 16:29 Sheryl Wang 阅读(178) 评论(0) 推荐(0) 编辑

3Sum Closest

摘要: Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. 阅读全文

posted @ 2016-06-29 16:17 Sheryl Wang 阅读(151) 评论(0) 推荐(0) 编辑

3Sum

摘要: Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of 阅读全文

posted @ 2016-06-29 16:10 Sheryl Wang 阅读(219) 评论(0) 推荐(0) 编辑

N-Queens

摘要: 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 阅读全文

posted @ 2016-06-29 15:45 Sheryl Wang 阅读(222) 评论(0) 推荐(0) 编辑

上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 21 下一页

导航