Create the graph from the input sub - sequences
let adj = [ ] ; for ( let i = 0 ; i < V ; i ++ ) { adj . push ( [ ] ) ; } for ( let i = 0 ; i < v . length ; i ++ ) { for ( let j = 0 ; j < v [ i ] . length - 1 ; j ++ ) {