A square matrix is said to be an X-Matrix if both of the following conditions hold:
0.Given a 2D integer array grid of size n x n representing a square matrix, return true if grid is an X-Matrix. Otherwise, return false.
n == grid.length == grid[i].length3 <= n <= 1000 <= grid[i][j] <= 10^5grid = [[2,0,0,1],[0,3,1,0],[0,5,2,0],[4,0,0,2]]truegrid = [[5,7,0],[0,3,1],[0,5,0]]false