VectorShift interview question

Use Python to implement a DAG algorithm