Given a directed graph with n nodes and a list of directed edges, a mother vertex is a node from which all other nodes are reachable. Return the smallest-labeled mother vertex, or -1 if none exists. The input is JSON {n, edges}.
Input: JSON {n, edges}.
Output: Integer — the smallest mother vertex, or -1.
Input: {"n":4,"edges":[[0,1],[0,2],[1,3],[2,3]]}
Output: 0
Explanation: All nodes reachable from 0.Input: {"n":3,"edges":[[0,1],[2,1]]}
Output: -1
Explanation: No single source reaches all.Input: {"n":3,"edges":[[0,1],[1,2]]}
Output: 0
Explanation: 0 reaches 1 and 2.1<=n<=10^5directed