摘要: Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. Example: divide and conquer,用merge 2 sorted list作为函 阅读全文
posted @ 2018-12-04 18:16 fatttcat 阅读(123) 评论(0) 推荐(0) 编辑
摘要: Given a set of N people (numbered 1, 2, ..., N), we would like to split everyone into two groups of any size. Each person may dislike some other peopl 阅读全文
posted @ 2018-12-04 15:22 fatttcat 阅读(171) 评论(0) 推荐(0) 编辑
摘要: Given an undirected graph, return true if and only if it is bipartite. Recall that a graph is bipartite if we can split it's set of nodes into two ind 阅读全文
posted @ 2018-12-04 14:40 fatttcat 阅读(185) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm's runtime com 阅读全文
posted @ 2018-12-04 13:53 fatttcat 阅读(119) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x, n), which calculates x raised to the power n (xn). Example 1: Example 2: Example 3: Note: -100.0 < x < 100.0 n is a 32-bit signed int 阅读全文
posted @ 2018-12-04 13:28 fatttcat 阅读(122) 评论(0) 推荐(0) 编辑
摘要: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,0,1,2,2,5,6] might become [2,5,6,0,0,1,2]). Y 阅读全文
posted @ 2018-12-04 12:27 fatttcat 阅读(110) 评论(0) 推荐(0) 编辑
摘要: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). Y 阅读全文
posted @ 2018-12-04 11:47 fatttcat 阅读(117) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array, two integers k and x, find the k closest elements to x in the array. The result should also be sorted in ascending order. If the 阅读全文
posted @ 2018-12-04 09:25 fatttcat 阅读(171) 评论(0) 推荐(0) 编辑
摘要: You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c 阅读全文
posted @ 2018-12-04 05:13 fatttcat 阅读(83) 评论(0) 推荐(0) 编辑
摘要: Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., [0,1,2,4,5,6,7] might become [4,5,6,7,0,1,2]). F 阅读全文
posted @ 2018-12-04 04:59 fatttcat 阅读(111) 评论(0) 推荐(0) 编辑
摘要: Given n non-negative integers a1, a2, ..., an , where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endp 阅读全文
posted @ 2018-12-04 02:57 fatttcat 阅读(105) 评论(0) 推荐(0) 编辑