code: def backtracking(columns, order):
      # columns and order are references, no extra memory for those arrays (they are just pointers)
      n = len(columns)
  
      if len(order) == n:
          return 1
  
      total = 0
  
      for i in range(n):
          if (not columns[i]) and check_diagonals(order, i):
              order.append(i)
              columns[i] = True
              total += backtracking(columns, order)
              # return to the old state
              columns[i] = False
              del order[-1]
  
      return total
  
label_desc: Use image node_id 2 for calling a global function with example usage: backtracking(columns, order) and returns: total, int