Exemple #1
0
def test_0():
    t = WordDictionary()
    assert not t.search('.')
    assert not t.search('a')
    t.addWord('a')
    assert t.search('.')
    assert t.search('a')
Exemple #2
0
def test_1():
    t = WordDictionary()
    t.addWord("bad")
    t.addWord("dad")
    t.addWord("mad")
    assert not t.search("pad")
    assert t.search("bad")
    assert t.search(".ad")
    assert t.search("b..")
Exemple #3
0
#!/usr/bin/env python
# -*- coding: utf-8 -*-

from solution import WordDictionary

wordDictionary = WordDictionary()
wordDictionary.addWord("a")
wordDictionary.addWord("a")
print(wordDictionary.search("."))
print(wordDictionary.search(".a"))
print(wordDictionary.search("a."))