Skip to content

Commit 51c21e0

Browse files
refactor 208
1 parent 8468524 commit 51c21e0

File tree

1 file changed

+15
-3
lines changed
  • src/main/java/com/fishercoder/solutions

1 file changed

+15
-3
lines changed

src/main/java/com/fishercoder/solutions/_208.java

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,21 @@
44
* 208. Implement Trie (Prefix Tree)
55
*
66
* Implement a trie with insert, search, and startsWith methods.
7-
8-
Note:
9-
You may assume that all inputs are consist of lowercase letters a-z.
7+
*
8+
* Example:
9+
*
10+
* Trie trie = new Trie();
11+
*
12+
* trie.insert("apple");
13+
* trie.search("apple"); // returns true
14+
* trie.search("app"); // returns false
15+
* trie.startsWith("app"); // returns true
16+
* trie.insert("app");
17+
* trie.search("app"); // returns true
18+
* Note:
19+
*
20+
* You may assume that all inputs are consist of lowercase letters a-z.
21+
* All inputs are guaranteed to be non-empty strings.
1022
*/
1123

1224
public class _208 {

0 commit comments

Comments
 (0)