3303. Find the Occurrence of First Almost Equal Substring
You are given two strings
s
andpattern
.A string
x
is called almost equal toy
if you can change at most one character inx
to make it identical toy
.Return the smallest starting index of a substring in
s
that is almost equal topattern
. If no such index exists, return-1
.A substring is a contiguous non-empty sequence of characters within a string.
c++
1 | vector<int> zfunction(string s) { |