当前位置:网站首页>Not for 60 days, magical dictionary
Not for 60 days, magical dictionary
2022-07-29 04:16:00 【A little Ming】

class MagicDictionary {
private String[] words;
public MagicDictionary() {
}
public void buildDict(String[] dictionary) {
words = dictionary;
}
public boolean search(String searchWord) {
for (String word : words) {
if (word.length() != searchWord.length()) {
continue;
}
int diff = 0;
for (int i = 0; i < word.length(); ++i) {
if (word.charAt(i) != searchWord.charAt(i)) {
++diff;
if (diff > 1) {
break;
}
}
}
if (diff == 1) {
return true;
}
}
return false;
}
}
author :LeetCode-Solution
link :https://leetcode.cn/problems/US1pGT/solution/shen-qi-de-zi-dian-by-leetcode-solution-uvh3/
source : Power button (LeetCode)
The copyright belongs to the author . Commercial reprint please contact the author for authorization , Non-commercial reprint please indicate the source .边栏推荐
- 数据集成这个地方的过滤条件该咋写,用的啥语法?sql语法处理bizdate可以不
- GBase 8a特殊场景下屏蔽 ODBC 负载均衡方式?
- C语言:结构体简单语法总结
- Codeforces round 810 (Div. 2) d. rain (segment tree difference)
- Two forms of softmax cross entropy + numpy implementation
- Note: restframe work records many to one tables, how to serialize in that table (reverse query)
- opengauss预检查安装
- 有没有大佬帮我看下flink sql连接kafka认证kerberos的参数配置是否有误
- Wechat applet parameter transfer
- Don't the JDBC SQL connector of the big guys Flink now support all databases, such as vertica?
猜你喜欢

STM32F103ZET6程序移植为C8T6+C8T6下载程序flash timeout的解决方案

不会就坚持64天吧 查找插入位置

你真的会写Restful API吗?

伏英娜:元宇宙就是新一代互联网!

Code or script to speed up the video playback of video websites

Machine vision Series 2: vs DLL debugging

Record of problems encountered in ROS learning

不会就坚持67天吧 平方根

不会就坚持60天吧 神奇的字典

Install the laser of ROS_ scan_ Problems encountered in match library (I)
随机推荐
Is there any way for Youxuan database to check the log volume that the primary cluster transmits to the standby cluster every day?
不会就坚持60天吧 神奇的字典
BIO、NIO、AIO的区别和原理
The pit I walked through: the first ad Sketchpad
Incubator course design (April 12, 2021)
Change the value of the argument by address through malloc and pointer
C language: getchar () and cache
Pointer of pointer???...
Rhel8 patch package production
有一种密码学专用语言叫做ASN.1
不会就坚持64天吧 查找插入位置
Const char* and char*, string constants
LCA 板子
Deep learning training strategy -- warming up the learning rate
Common components of solder pad (2021.4.6)
Leftmost prefix principle of index
[kvm] create virtual machine from kickstart file
不会就坚持65天吧 只出现一次的数字
从淘宝,天猫,1688,微店,京东,苏宁,淘特等其他平台一键复制商品到拼多多平台(批量上传宝贝详情接口教程)
Blood cases caused by < meta charset=UTF-8> -- Analysis of common character codes