Adjacency list containing list of children
private static List < List < Integer > > adj ; GFG ( int N ) { this . N = N ; adj = new ArrayList < > ( N ) ; for ( int i = 0 ; i < N ; i ++ ) adj . add ( new ArrayList < > ( ) ) ; }