摘要: Given N axis-aligned rectangles where N > 0, determine if they all together form an exact cover of a rectangular region. Each rectangle is represented 阅读全文
posted @ 2016-09-01 13:04 LiBlog 阅读(328) 评论(0) 推荐(0) 编辑
摘要: Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. For example, given n = 12, 阅读全文
posted @ 2016-09-01 12:11 LiBlog 阅读(131) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, return 1 - n in lexicographical order. For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9]. Please optimize your algori 阅读全文
posted @ 2016-09-01 09:23 LiBlog 阅读(209) 评论(0) 推荐(0) 编辑
摘要: Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two 阅读全文
posted @ 2016-09-01 08:14 LiBlog 阅读(170) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. For example, given the following ma 阅读全文
posted @ 2016-09-01 07:36 LiBlog 阅读(150) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n. For example: Given n = 13, Retur 阅读全文
posted @ 2016-09-01 03:36 LiBlog 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target. 阅读全文
posted @ 2016-09-01 02:47 LiBlog 阅读(148) 评论(0) 推荐(0) 编辑