上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 36 下一页
摘要: Given a n x n matrix where each of the rows and columns are sorted in ascending order, find the kth smallest element in the matrix. Note that it is th 阅读全文
posted @ 2016-08-09 01:04 LiBlog 阅读(226) 评论(0) 推荐(0) 编辑
摘要: Design a Phone Directory which supports the following operations: Example: Analysis: We record the last used number and also maintain a hashset to rec 阅读全文
posted @ 2016-08-08 13:23 LiBlog 阅读(386) 评论(0) 推荐(0) 编辑
摘要: Given an integer matrix, find the length of the longest increasing path. From each cell, you can either move to four directions: left, right, up or do 阅读全文
posted @ 2016-08-08 04:57 LiBlog 阅读(166) 评论(0) 推荐(0) 编辑
摘要: Given a sorted positive integer array nums and an integer n, add/patch elements to the array such that any number in range [1, n] inclusive can be for 阅读全文
posted @ 2016-08-08 03:47 LiBlog 阅读(144) 评论(0) 推荐(0) 编辑
摘要: Given an unsorted array nums, reorder it in-place such that nums[0] <= nums[1] >= nums[2] <= nums[3].... For example, given nums = [3, 5, 2, 1, 6, 4], 阅读全文
posted @ 2016-08-07 13:31 LiBlog 阅读(161) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the 阅读全文
posted @ 2016-08-07 13:12 LiBlog 阅读(127) 评论(0) 推荐(0) 编辑
摘要: One way to serialize a binary tree is to use pre-order traversal. When we encounter a non-null node, we record the node's value. If it is a null node, 阅读全文
posted @ 2016-08-07 12:35 LiBlog 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given a list of airline tickets represented by pairs of departure and arrival airports [from, to], reconstruct the itinerary in order. All of the tick 阅读全文
posted @ 2016-08-06 14:41 LiBlog 阅读(192) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, find the largest subtree which is a Binary Search Tree (BST), where largest means subtree with largest number of nodes in it. Not 阅读全文
posted @ 2016-08-05 14:46 LiBlog 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the length of the longest substring T that contains at most k distinct characters. For example, Given s = “eceba” and k = 2, T is 阅读全文
posted @ 2016-08-05 13:12 LiBlog 阅读(177) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 36 下一页