Path is allowed if size of present node becomes 0 i . e it has no child root and no more than m consecutive 1 's
if ( adj [ node ] . length == 1 && node != 1 ) { ans ++ ; } for ( let x = 0 ; x < adj [ node ] . length ; x ++ ) { if ( visited [ adj [ node ] [ x ] ] == 0 ) { dfs ( adj [ node ] [ x ] , count , m , arr , k ) ; } } }