comefrom: <doocs>2319.Check if Matrix Is X-Matrix_1.py
code: def checkXMatrix( grid: List[List[int]]) -> bool:
      n = len(grid)
      for i, row in enumerate(grid):
          for j, v in enumerate(row):
              if i == j or i == n - j - 1:
                  if v == 0:
                      return False
              elif v:
                  return False
      return True
masked: def sample_funcname ( var_0 : List [ List [ int ] ] ) -> bool :
      var_1 = len ( var_0 )
      for var_2 , var_3 in enumerate ( var_0 ) :
          for var_4 , var_5 in enumerate ( var_3 ) :
              if var_2 == var_4 or var_2 == var_1 - var_4 - 1 :
                  if var_5 == 0 :
                      return False
              elif var_5 :
                  return False
      return True
  