Solving Maximal Square in Javascript. Please try yourself first to solve the problem and submit your implementation to LeetCode before looking into solution.

Problem Description

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:

Input:
1 0 1 0 0
1 0 1 1 1
1 1 1 1 1
1 0 0 1 0

Output: 4

See the full details of the problem Maximal Square at LeetCode

Originally posted at: @github.com/ignacio-chiazzo/Algorithms-Leetcode-Javascript