input: Write a python function to solve the scheduling problem using a greedy algorithm.
  assert solve_scheduling([1, 3, 0, 5, 8, 5], [2, 4, 6, 7, 9, 9], [20, 15, 30, 10, 25, 5]) == ([1, 2, 4, 5], 70)
  assert solve_scheduling([1, 2, 4, 1, 2], [3, 5, 6, 8, 9], [50, 20, 10, 30, 40]) == ([1, 4, 5], 120)
  assert solve_scheduling([1, 2, 3, 4], [2, 3, 4, 5], [10, 20, 30, 40]) == ([1, 2, 3, 4], 100)
output: def solve_scheduling(start_times, end_times, profits):
      jobs = sorted(zip(start_times, end_times, profits), key=lambda x: x[1])
      n = len(jobs)
  
      dp = [0] * (n + 1)
      selected_jobs = [[] for _ in range(n + 1)]
  
      for i in range(1, n + 1):
          dp[i] = dp[i-1]
          selected_jobs[i] = selected_jobs[i-1][:]
          
          profit_with_current = jobs[i-1][2]
          last_non_conflict = -1
          
          for j in range(i-1, -1, -1):
              if jobs[j][1] <= jobs[i-1][0]:
                  last_non_conflict = j
                  break
  
          if last_non_conflict != -1:
              profit_with_current += dp[last_non_conflict + 1]
  
          if profit_with_current > dp[i]:
              dp[i] = profit_with_current
              selected_jobs[i] = selected_jobs[last_non_conflict + 1][:]
              selected_jobs[i].append(i)
  
      max_profit = dp[-1]
      job_indices = [i for i in selected_jobs[-1]]
  
      return (job_indices, max_profit)