摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area. 阅读全文
posted @ 2019-06-25 23:46 yjxyy 阅读(157) 评论(0) 推荐(0) 编辑
摘要: Find the **k**th largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element. 阅读全文
posted @ 2019-06-25 23:41 yjxyy 阅读(137) 评论(0) 推荐(0) 编辑
摘要: There are a total of *n* courses you have to take, labeled from `0` to `n-1`. Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: `[0,1]` Given the total number of courses and a list of prerequisite **pairs**, is it possible for you to finish all courses? 阅读全文
posted @ 2019-06-25 23:37 yjxyy 阅读(474) 评论(0) 推荐(0) 编辑
摘要: Given a 2d grid map of `'1'`s (land) and `'0'`s (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacent lands horizontally or vertically. You may assume all four edges of the grid are all surrounded by water. 阅读全文
posted @ 2019-06-25 16:49 yjxyy 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Given an integer array `nums`, find the contiguous subarray within an array (containing at least one number) which has the largest product. 阅读全文
posted @ 2019-06-25 16:43 yjxyy 阅读(126) 评论(0) 推荐(0) 编辑