摘要: Given a mountain sequence of n integers which increase firstly and then decrease, find the mountain top. Example Given nums = [1, 2, 4, 8, 6, 3] retur 阅读全文
posted @ 2017-09-23 04:32 jasminemzy 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in an m x n matrix, return the occurrence of it. This matrix has the following properties: Inte 阅读全文
posted @ 2017-09-22 14:08 jasminemzy 阅读(85) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties: Integers in each row are sorted f 阅读全文
posted @ 2017-09-22 07:46 jasminemzy 阅读(105) 评论(0) 推荐(0) 编辑
摘要: Find the last position of a target number in a sorted array. Return -1 if target does not exist. Example Given [1, 2, 2, 4, 5, 5]. For target = 2, ret 阅读全文
posted @ 2017-09-22 06:27 jasminemzy 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Given a target number and an integer array A sorted in ascending order, find the index i in A such that A[i] is closest to the given target. Return -1 阅读全文
posted @ 2017-09-22 06:08 jasminemzy 阅读(120) 评论(0) 推荐(0) 编辑
摘要: Given a list of numbers with duplicate number in it. Find all unique permutations. Example For numbers [1,2,2] the unique permutations are: [ [1,2,2], 阅读全文
posted @ 2017-09-21 14:15 jasminemzy 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Given a list of numbers, return all possible permutations. Notice You can assume that there is no duplicate numbers in the list. Example For nums = [1 阅读全文
posted @ 2017-09-21 07:42 jasminemzy 阅读(95) 评论(0) 推荐(0) 编辑
摘要: Given a list of numbers that may has duplicate numbers, return all possible subsets Notice Each element in a subset must be in non-descendingorder. Th 阅读全文
posted @ 2017-09-21 05:42 jasminemzy 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Given a set of distinct integers, return all possible subsets. Notice Elements in a subset must be in non-descending order. The solution set must not 阅读全文
posted @ 2017-09-21 03:24 jasminemzy 阅读(100) 评论(0) 推荐(0) 编辑
摘要: For a given source string and a target string, you should output the first index(from 0) of target string in source string. If target does not exist i 阅读全文
posted @ 2017-09-20 12:45 jasminemzy 阅读(109) 评论(0) 推荐(0) 编辑