摘要: Given two sorted integer arrays A and B, merge B into A as one sorted array. A = [1, 2, 3, empty, empty], B = [4, 5] After merge, A will be filled as  阅读全文
posted @ 2016-03-02 13:41 哥布林工程师 阅读(175) 评论(0) 推荐(0) 编辑
摘要: Given a collection of intervals, merge all overlapping intervals. Given intervals => merged intervals: [ [ [1, 3], [1, 6], [2, 6], => [8, 10], [8, 10] 阅读全文
posted @ 2016-03-02 13:26 哥布林工程师 阅读(226) 评论(0) 推荐(0) 编辑
摘要: Given a unsorted array with integers, find the median of it. A median is the middle number of the array after it is sorted. If there are even numbers 阅读全文
posted @ 2016-03-02 13:18 哥布林工程师 阅读(179) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find a contiguous subarray which has the largest sum. Given the array [−2,2,−3,4,−1,2,1,−5,3], the contiguous subarray[4,− 阅读全文
posted @ 2016-02-27 08:21 哥布林工程师 阅读(100) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l 阅读全文
posted @ 2016-02-27 08:07 哥布林工程师 阅读(103) 评论(0) 推荐(0) 编辑
摘要: Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in ZigZag-order. Given a matrix: [ [1, 2, 3, 4], [5, 6, 7, 8], 阅读全文
posted @ 2016-02-27 07:53 哥布林工程师 阅读(193) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, the majority number is the number that occurs more than half of the size of the array. Find it. Example Given [1, 1, 1, 1, 阅读全文
posted @ 2016-02-26 08:02 哥布林工程师 阅读(164) 评论(0) 推荐(0) 编辑
摘要: Given a dictionary, find all of the longest words in the dictionary. Example Given { "dog", "google", "facebook", "internationalization", "blabla" } t 阅读全文
posted @ 2016-02-26 07:41 哥布林工程师 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Give an integer array,find the longest increasing continuous subsequence in this array. An increasing continuous subsequence: Can be from right to lef 阅读全文
posted @ 2016-02-26 07:17 哥布林工程师 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string. If the last word 阅读全文
posted @ 2016-02-26 03:38 哥布林工程师 阅读(100) 评论(0) 推荐(0) 编辑