Graph = > 1 -- -- 2 -- -- 3 -- -- 4 | | 5 -- -- 6
n = 6 ; m = 6 ; for ( let i = 0 ; i < v . length ; i ++ ) v [ i ] = [ ] ; for ( let i = 0 ; i < g . length ; i ++ ) g [ i ] = [ ] ; v [ 1 ] . push ( 2 ) ; v [ 2 ] . push ( 1 ) ; v [ 2 ] . push ( 3 ) ; v [ 3 ] . push ( 2 ) ; v [ 2 ] . push ( 5 ) ; v [ 5 ] . push ( 2 ) ; v [ 5 ] . push ( 6 ) ; v [ 6 ] . push ( 5 ) ; v [ 6 ] . push ( 3 ) ; v [ 3 ] . push ( 6 ) ; v [ 3 ] . push ( 4 ) ; v [ 4 ] . push ( 4 ) ; let ans = findMaxBridges ( ) ; document . write ( ans + " " ) ;