Return the number of count of non - accessible cells .
static int countNonAccessible ( List < int > [ ] graph , int N ) { bool [ ] visited = new bool [ N * N + N ] ; int ans = 0 ; for ( int i = 1 ; i <= N * N ; i ++ ) { if ( ! visited [ i ] ) { visited [ i ] = true ;