SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 68 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. func getNodesList(word: String) -> [TrieNode]? {
  2.         var nodes : [TrieNode] = [root]
  3.         var node = root
  4.         for char in word {
  5.             if node.children[char] == nil {
  6.                 return nil
  7.             }
  8.             node = node.children[char]!
  9.             nodes.append(node)
  10.         }
  11.         return nodes
  12.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top