Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var DigitLetters = map[rune][]rune{
'0': {},
'1': {},
'2': {'a', 'b', 'c'},
'3': {'d', 'e', 'f'},
'4': {'g', 'h', 'i'},
'5': {'j', 'k', 'l'},
'6': {'m', 'n', 'o'},
'7': {'p', 'q', 'r', 's'},
'8': {'t', 'u', 'v'},
'9': {'w', 'x', 'y', 'z'},
}
View Source
var LetterDigits = map[rune]rune{
'a': '2',
'b': '2',
'c': '2',
'd': '3',
'e': '3',
'f': '3',
'g': '4',
'h': '4',
'i': '4',
'j': '5',
'k': '5',
'l': '5',
'm': '6',
'n': '6',
'o': '6',
'p': '7',
'q': '7',
'r': '7',
's': '7',
't': '8',
'u': '8',
'v': '8',
'w': '9',
'x': '9',
'y': '9',
'z': '9',
}
Functions ¶
func WordsInPhoneNumber ¶
WordsInPhoneNumber O(n^2 + m * w) time | O(n^2 + m * w) space - where n is the length of the phone number, m is the number of words, and w is the length of the longest word
Types ¶
type ModifiedSuffixTrie ¶
type ModifiedSuffixTrie map[byte]ModifiedSuffixTrie
func NewModifiedSuffixTrie ¶
func NewModifiedSuffixTrie() ModifiedSuffixTrie
func (ModifiedSuffixTrie) Contains ¶
func (trie ModifiedSuffixTrie) Contains(str string) bool
Contains O(m) time | O(1) space
func (ModifiedSuffixTrie) PopulateModifiedSuffixTrieFrom ¶
func (trie ModifiedSuffixTrie) PopulateModifiedSuffixTrieFrom(str string)
PopulateModifiedSuffixTrieFrom O(n^2) time | O(n^2) space
Click to show internal directories.
Click to hide internal directories.