分类:全部列表
[LeetCode]85.MaximalRectangle最大矩形Givena2Dbinarymatrixfilledwith0'sand1's,findthelargestrectanglecontainingonly1'sandreturnitsarea.Example:Input:[["1","0","1","0","0"],["1","0","1","1","1"],["1","1","1","1","1"],["1","0","0","1","0"]]Output:6此题是之前那道的 LargestRectangleinHistogram 的扩展,这道题的二维矩阵每一层向上都可以看做一个直方图,输入矩阵有多少行...
继续阅读 >
[LeetCode]81.SearchinRotatedSortedArrayII在旋转有序数组中搜索之二Supposeanarraysortedinascendingorderisrotatedatsomepivotunknowntoyoubeforehand.(i.e., [0,0,1,2,2,5,6] mightbecome [2,5,6,0,0,1,2]).Youaregivenatargetvaluetosearch.Iffoundinthearrayreturn true,otherwisereturn false.Example1:Input:nums=[2,5,6,0,0,1,2],target=0Output...
继续阅读 >