# Graph structure problem, is my code correct?

given a directed graph contain groups of nodes, a node in the graph can't access all the node in the graph. Each node will only point to one node or nothing (null), return the number of groups in this graph.

The array stores all node in the graph