Maximal Square
Question
1 0 1 0 0
1 0 1 1 1
1 1 1 1 1
1 0 0 1 0Analysis
Solution
Standard Dynamic Programming
LeetCode version (char[][] as input) - (12ms 30.09%)
char[][] as input) - (12ms 30.09%)A smart way to bypass initialization, use m + 1, n + 1 as dp[][] dimension:
m + 1, n + 1 as dp[][] dimension:Space optimized DP - O(mn) time, O(n) space
Reference
Last updated