leetcode--Add and Search Word
来源:互联网 发布:mysql 查询有数据的表 编辑:程序博客网 时间:2024/05/24 15:36
Design a data structure that supports the following two operations:
void addWord(word)bool search(word)
search(word) can search a literal word or a regular expression string containing only letters a-z
or .
. A .
means it can represent any one letter.
For example:
addWord("bad")addWord("dad")addWord("mad")search("pad") -> falsesearch("bad") -> truesearch(".ad") -> truesearch("b..") -> true
Note:
You may assume that all words are consist of lowercase letters a-z
.
click to show hint.
You should be familiar with how a Trie works. If not, please work on this problem: Implement Trie (Prefix Tree) first.
原文链接http://blog.csdn.net/crazy__chen/article/details/46576277
阅读全文
0 0
- [LeetCode] Add and Search Word
- leetcode--Add and Search Word
- Leetcode 211 Add and Search Word
- Leetcode 211. Add and Search Word
- LeetCode 211 Add and Search Word
- 20170602-leetcode-211-Add and Search Word
- [Leetcode] 211. Add and Search Word
- [leetcode]211. Add and Search Word
- leetcode 211. Add and Search Word
- leetcode 211. Add and Search Word
- leetcode 211. Add and Search Word
- add-and-search-word
- Add and Search Word
- Add and Search Word
- Add and Search Word
- LeetCode 211 - Add and Search Word - Data structure design
- LeetCode Add and Search Word - Data structure design
- Leetcode Add and Search Word - Data structure design
- LeetCode-Easy-Java-Palindrome Number
- react入门,控制台报“React.render is not a function”错误
- SQL中group by的使用
- IntentFilter学习笔记
- Glide图片家在框架的使用
- leetcode--Add and Search Word
- JS-信息滚动效果
- 欢迎使用CSDN-markdown编辑器
- kindeditor在线编辑器的使用心得
- CUDA C最佳实践-CUDA Best Practices(一)
- 【unity 5学习记录】 可编辑地形 网格(类似minecraft)17.8.8
- CentOS7.2安装gitlab8.2.1教程
- [最详细的FAAC1.28交叉编译过程] AAC算法移植
- RegExp对象