function getBuildOrder(projects, dependencies) {
  const list = [];

  // build graph
  const graph = new Graph();

  projects.forEach(function (project) {
    graph.add(project);
  });

  dependencies.forEach(function ([source, target]) {
    graph.add(source, target);
  });

  // do DFS and unshift elements
  const nodes = graph.getNodes();

  try {
    nodes.forEach(function (node) {
      doDFS(node, list);
    });
  } catch (e) {
    console.log(e.name + ': ' + e.message);
  }

  return list;
}
4.7 Build Order: You are given a list of projects and a list of dependencies (which is a list of pairs of projects, where the second project is dependent on the first project). All of a project's dependencies must be built before the project is. Find a build order that will allow the projects to be built. If there is no valid build order, return an error.

 EXAMPLE

 Input:
 projects: a, b, c, d, e, f
 dependencies: (a, d), (f, b), (b, d), (f, a), (d, c)

 Output: f, e, a, b, d, c

@param projects
@param dependencies
@returns {Array}