Given a binary matrix of 0s and 1s, find the largest square containing only 1s and return its area. The input is JSON {matrix}.
Input: JSON {matrix}.
Output: Integer — the area of the largest all-ones square.
Input: {"matrix":[[1,0,1,0,0],[1,0,1,1,1],[1,1,1,1,1],[1,0,0,1,0]]}
Output: 4
Explanation: A 2x2 square of ones.Input: {"matrix":[[0,1],[1,0]]}
Output: 1
Explanation: Only 1x1 squares.Input: {"matrix":[[0]]}
Output: 0
Explanation: No ones.1<=rows,cols<=300