public boolean startsWith(String word) {
        TrieNode t = root;
        for (int i = 0; i < word.length(); i++) {
            int index = word.charAt(i) - 'a';
            if (t.children[index] == null) return false;
            t = t.children[index];
        }
        return true;
    }
Returns if there is any word in the trie that starts with the given prefix.
src/algo/string/Trie.java