Driver code
let T = new Trie ( ) ; let str = [ " " , " " , " " , " " , " " , " " ] ; let n = 6 ; for ( let i = 0 ; i < n ; i ++ ) { T . addWord ( str [ i ] ) ; } let ans = T . dfshelper ( ) ; document . write ( ans ) ;