Driver code
n = 7 ; m = 7 ; a = 3 ; b = 5 ; let edges = [ [ 1 , 2 ] , [ 2 , 3 ] , [ 3 , 4 ] , [ 4 , 5 ] , [ 5 , 6 ] , [ 6 , 7 ] , [ 7 , 5 ] ] ; let v = new Array ( n + 1 ) ; for ( let i = 0 ; i <= n ; i ++ ) { v [ i ] = [ ] ; }