input: Write a python function to solve the Traveling Salesman Problem using pulp.
  assert solve_tsp(4, [[0, 8, 2, 10], [8, 0, 4, 12], [2, 4, 0, 9], [10, 12, 9, 0]]) == [1, 3, 2, 4]
  assert solve_tsp(3, [[0, 10, 15], [10, 0, 20], [15, 20, 0]]) == [1, 2, 3]
output: import pulp
  from itertools import permutations
  
  def solve_tsp(n, dist_matrix):
      # Define the problem
      prob = pulp.LpProblem("TSP", pulp.LpMinimize)
      
      # Variables: x[i][j] is 1 if path goes from i to j, 0 otherwise
      x = [[pulp.LpVariable(f"x_{i}_{j}", cat='Binary') for j in range(n)] for i in range(n)]
      
      # Objective function: Minimize the total distance
      prob += pulp.lpSum(dist_matrix[i][j] * x[i][j] for i in range(n) for j in range(n))
  
      # Constraints: Each city must be entered and left exactly once
      for i in range(n):
          prob += pulp.lpSum(x[i][j] for j in range(n) if i != j) == 1
          prob += pulp.lpSum(x[j][i] for j in range(n) if i != j) == 1
  
      # Add subtour elimination constraints
      def get_subtours(tour):
          return [tour[i:j] for i in range(len(tour)) for j in range(i+1, len(tour)+1)]
  
      # Solve the relaxed problem first
      prob.solve()
      
      # Extract the solution matrix
      solution = [[pulp.value(x[i][j]) for j in range(n)] for i in range(n)]
      
      def find_tour():
          tour = []
          current_city = 0
          while len(tour) < n:
              tour.append(current_city)
              next_city = next(i for i in range(n) if solution[current_city][i] == 1)
              current_city = next_city
          return tour
  
      tour = find_tour()
      
      return [city + 1 for city in tour]