We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 992c7a0 commit 7fddceaCopy full SHA for 7fddcea
data_structures/trie/trie.py
@@ -48,10 +48,8 @@ class Trie:
48
>>> trie.insert("hello")
49
>>> trie.search("hello")
50
True
51
- >>> trie.search("hell")
+ >>> trie.search("world")
52
False
53
- >>> trie.starts_with("hel") # noqa: codespell
54
- True
55
"""
56
57
def __init__(self) -> None:
@@ -252,13 +250,9 @@ def starts_with(self, prefix: str) -> bool:
252
250
>>> trie = Trie()
253
251
254
>>> trie.insert("help")
255
256
257
- >>> trie.starts_with("hello")
258
259
- >>> trie.starts_with("hey")
+ >>> trie.starts_with("world")
260
261
- >>> trie.starts_with("h")
+ >>> trie.starts_with("hello")
262
263
264
current_node = self.root
0 commit comments