You are given the two integers, n and m and two integer arrays, hBars
and vBars. The grid has n + 2 horizontal and m + 2 vertical bars, creating 1 x 1 unit cells. The bars are indexed starting from 1.
You can remove some of the bars in hBars from horizontal bars and some of the bars in vBars from vertical bars. Note that other bars are fixed and cannot be removed.
Return an integer denoting the maximum area of a square-shaped hole in the grid, after removing some bars (possibly none).
Input: n =2, m =1, hBars =[2,3], vBars =[2]Output: 4Explanation:
The left image shows the initial grid formed by the bars. The horizontal bars
are `[1,2,3,4]`, and the vertical bars are `[1,2,3]`.One way to get the maximum square-shaped hole is by removing horizontal bar 2and vertical bar 2.
Input: n =1, m =1, hBars =[2], vBars =[2]Output: 4Explanation:
To get the maximum square-shaped hole, we remove horizontal bar 2 and vertical
bar 2.

Input: n =2, m =3, hBars =[2,3], vBars =[2,4]Output: 4Explanation:
One way to get the maximum square-shaped hole is by removing horizontal bar 3,and vertical bar 4.
The largest square hole is formed by removing consecutive horizontal and vertical bars, creating the largest possible gap between remaining bars. The side of the largest square is determined by the maximum number of consecutive removed bars plus one (since a gap of k bars removed creates a hole of size k+1).