Given a map tasks where each key is a task name and its value is the list of tasks it depends on, return any valid order of the tasks: every task must come after all of its dependencies. The report describes it as almost the same as LeetCode Course Schedule,…