摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square which diagonal is all 1 and others is 0. Only consider the main diagonal sit 阅读全文
posted @ 2017-08-19 11:40 Review->Improve 阅读(776) 评论(0) 推荐(0) 编辑
摘要: Given a 2D matrix where every element is either ‘O’ or ‘X’, find the largest subsquare surrounded by ‘X’. Examples: Solution 1. O(N^4) runtime. Consid 阅读全文
posted @ 2017-08-19 08:47 Review->Improve 阅读(368) 评论(0) 推荐(0) 编辑
摘要: Given a 2D binary matrix filled with 0's and 1's, find the largest square containing all 1's and return its area. For example, given the following mat 阅读全文
posted @ 2017-08-19 07:27 Review->Improve 阅读(203) 评论(0) 推荐(0) 编辑
摘要: Given a number n, find the total number of numbers from 0 to 2^n - 1 which do not have consecutive 1s in their binary representation. Solution. This p 阅读全文
posted @ 2017-08-19 04:15 Review->Improve 阅读(104) 评论(0) 推荐(0) 编辑
摘要: Give a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from root node down to the nearest leaf n 阅读全文
posted @ 2017-08-19 04:05 Review->Improve 阅读(143) 评论(0) 推荐(0) 编辑