code: def safe_squares_rooks(rooks, n):
      rows = set()
      cols = set()
  
      for i in range(n):
          rows.add(i)
          cols.add(i)
  
      for rook in rooks:
          if rook[0] in rows:
              rows.remove(rook[0])
          if rook[1] in cols:
              cols.remove(rook[1])
  
      return len(rows) * len(cols)
  
label_desc: Use image node_id 1 for calling a global function with example usage: safe_squares_rooks(rooks, n) and returns: unknown