code: int moveTasksFromBuffers(Task[] tasks) {
          int maxTaskIndex = -1;
          for (int i = 0; i < buffers.length; i++) {
              int maxIndex = moveTasksFromBuffer(tasks, i);
              maxTaskIndex = Math.max(maxIndex, maxTaskIndex);
          }
          return maxTaskIndex;
      }
docs: Moves the tasks from the buffers into the output array.
  
  @param tasks the ordered array of the pending operations
  @return the highest index location of a task that was added to the array