input: Write a python function to schedule jobs based on their duration.
  assert schedule([{'id': 1, 'duration': 3}, {'id': 2, 'duration': 5}, {'id': 3, 'duration': 2}]) == [{'id': 2, 'duration': 5, 'time_window': [0, 5]}, {'id': 1, 'duration': 3, 'time_window': [5, 8]}, {'id': 3, 'duration': 2}]
  assert schedule([{'id': 1, 'duration': 1}, {'id': 2, 'duration': 2}, {'id': 3, 'duration': 3}]) == [{'id': 3, 'duration': 3, 'time_window': [0, 3]}, {'id': 2, 'duration': 2, 'time_window': [3, 5]}, {'id': 1, 'duration': 1, 'time_window': [5, 6]}]
  assert schedule([{'id': 1, 'duration': 7}, {'id': 2, 'duration': 3}, {'id': 3, 'duration': 4}]) == [{'id': 1, 'duration': 7, 'time_window': [0, 7]}, {'id': 3, 'duration': 4, 'time_window': [7, 11]}, {'id': 2, 'duration': 3, 'time_window': [11, 14]}]
output: def schedule(jobs):
      # Sort jobs by duration in descending order
      jobs = sorted(jobs, key=lambda x: x['duration'], reverse=True)
      
      current_time = 0
      for job in jobs:
          job['time_window'] = [current_time, current_time + job['duration']]
          current_time += job['duration']
      
      return jobs