You are given strings s, a, and b, along with an integer k.
An index i is called beautiful if both conditions hold:
The substring of s starting at i matches a, meaning s[i..i + len(a) - 1] == a.
There exists an index j such that the substring of s starting at j matches b, meaning s[j..j + len(b) - 1] == b, and the distance between the starting indices satisfies |i - j| <= k.
Return all beautiful indices i in increasing order.
Constraints:
k s.length
a.length, b.length
s, a, and b contain only lowercase English letters.
You are given strings s, a, and b, along with an integer k.
An index i is called beautiful if both conditions hold:
The substring of s starting at i matches a, meaning s[i..i + len(a) - 1] == a.
There exists an index j such that the substring of s starting at j matches b, meaning s[j..j + len(b) - 1] == b, and the distance between the starting indices satisfies |i - j| <= k.
Return all beautiful indices i in increasing order.
Constraints:
k s.length
a.length, b.length
s, a, and b contain only lowercase English letters.