Matrix Questions
- Maximal Square
- Count Square Submatrices with All Ones
- Bomb Enemy
#
QuestionOriginal Question: Leetcode 221. Maximal Square
Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and return its area.
#
Example:#
Solution- Java
- Python
#
QuestionOriginal Question: Leetcode 1277. Count Square Submatrices with All Ones
Given a m * n matrix of ones and zeros, return how many square submatrices have all ones.
#
Example 1:#
Example 2:#
Solution- Java
- Python
;
#
QuestionOriginal Question: Leetcode 361. Bomb Enemy
Given a 2D grid, each cell is either a wall 'W', an enemy 'E' or empty '0' (the number zero), return the maximum enemies you can kill using one bomb. The bomb kills all the enemies in the same row and column from the planted point until it hits the wall since the wall is too strong to be destroyed. Note: You can only put the bomb at an empty cell.
#
Example:#
Solution- Java
- Python