#3303

Find the Occurrence of First Almost Equal Substring

grandmaster · 2285 · lc hard +32 · 15.4% accepted · 74 likes · top 0%

Description

You are given strings s and pattern. String x is almost equal to y if changing at most one character in x makes them identical. Return the smallest starting index of a substring of s almost equal to pattern, or -1 if none exists.

Code

1
2
3