Number of Substrings with Single Character Difference
题目地址(941. Number of Substrings with Single Character Difference)
题目描述
You are given two lowercase alphabet strings s and t. Return the number of pairs of substrings across s and t such that if we replace a single character to a different character, it becomes a substring of t.
Constraints
0 ≤ n ≤ 100 where n is the length of s
0 ≤ m ≤ 100 where m is the length of t
Example 1
Input
s = "ab"
t = "db"
Output
4
Explanation
We can have the following substrings:
"a" changed to "d"
"a" changed to "b"
"b" changed to "d"
"ab" changed to "db"前置知识
暴力法
思路
代码
动态规划
思路
关键点
代码
最后更新于
这有帮助吗?