def load_balance(n_workers, work):
    """Assigned work to n_workers to minimize max work assigned to worker.

    Sorts work lengths by decreasing order and assigns each work the the
    worker with the lowest current load.

    Args:
      n_workers (int, required): number of workers
      work (list, required): list where work_i is the approximate time the i_th
          work will take.

    Returns:
      list of len(work) where each value is the index of the worker that work_i
          is assigned to.
    """
    if not n_workers > 0:
        raise ValueError('n_workers must be > 0')
    if len(work) == 0: 
        raise ValueError('work cannot be an empty list')
    load = [0] * n_workers
    assignments = [0] * len(work)
    work = zip(range(len(work)), work)
    work = sorted(work, key=lambda x: x[1], reverse=True)
    for i, w in work:
        min_worker = load.index(min(load))
        load[min_worker] += w
        assignments[i] = min_worker
    return assignments