当前位置:网站首页>leetcode:6097. Match [set record + query one by one with the same length] after replacing characters
leetcode:6097. Match [set record + query one by one with the same length] after replacing characters
2022-06-12 18:43:00 【Review of the white speed Dragon King】

analysis
use set Record replaceable
And then s Find length and sub same
And then we'll see if we can map In the past
ac code
class Solution:
def matchReplacement(self, s: str, sub: str, mappings: List[List[str]]) -> bool:
n, m = len(s), len(sub)
mySet = set()
for x, y in mappings:
mySet.add((x, y))
#print(myDict)
for i in range(n - m + 1):
cankao = s[i: i + m]
#print(cankao)
flag = True
for j in range(m):
if sub[j] != cankao[j] and (sub[j], cankao[j]) not in mySet:
flag = False
break
if flag:
return True
return False
summary
Simple set
边栏推荐
- 2022.6.12-----leetcode.890
- Daily blog - micro service permission 12 matters
- General differences between SQL server versions released by Microsoft in different periods so far, for reference
- Self made calculator (1 realized by Boolean logic operation unit and control unit programming)
- GD32F4xx 与符合DLT645的电能表通信_2
- Implementing reflexive ACL in Cisco packet tracker
- 【sql语句基础】——查(select)(单表查询)
- OpenGL shadow implementation (soft shadow)
- 看不懂Kotlin源码?从Contracts 函数说起~
- Virtual Lab Basic Experiment tutoriel - 4. Diffraction à fente unique
猜你喜欢

在思科模拟器Cisco Packet Tracer实现自反ACL
![Free measurement of rectangular card [manual drawing ROI] Based on Halcon](/img/c5/d9109ed4024aff521e1788c63bff4e.png)
Free measurement of rectangular card [manual drawing ROI] Based on Halcon

Title 54: take 4 ~ 7 bits of an integer a from the right end.

从应无所住说起
![[blockbuster release] ant dynamic card, enabling the app home page to realize agile update](/img/65/5ed80090f4d0ee92b01888eb496528.jpg)
[blockbuster release] ant dynamic card, enabling the app home page to realize agile update

基于halcon—缺陷检测常用方法与示例总结

CVPR 2022 Oral 大连理工提出SCI:快速、超强的低光照图像增强方法

kali2022如何安装w3af

Review of MySQL (3): query operation

OpenGL shadow implementation (hard shadow)
随机推荐
2022.6.12-----leetcode. eight hundred and ninety
PHP:Fatal error: Allowed memory size of 262144 bytes exhausted (tried to allocat
Comparison of disk mapping tools for network disk and object cloud storage management
Pytest automated testing framework (II)
Title 37: sorting 10 numbers
liunx部署Seata(Nacos版)
GD32F4xx 与符合DLT645的电能表通信_2
Interior design style type, rendering 100 invitation code [1a12]
Can tonghuashun open an account? Can tonghuashun directly open the security of securities companies on the app
C language operation database (SQLite3) call interface function
MySQL - > > symbol usage JSON related
leetcode:5259. 计算应缴税款总额【简单模拟 + 看看在哪个区间】
Mysql ->>符号用法 Json相关
Regression analysis based on elasticnetcv
在思科模擬器Cisco Packet Tracer實現自反ACL
什么是网络代理
Review of MySQL (3): query operation
Quickly copy the request in browser F12 to postman/ or generate the corresponding code of the relevant language
Extracting strings with grep awk
Leetcode topic [string]-541- reverse string II