Solution: Find Beautiful Indices in the Given Array II
C# solution for the Find Beautiful Indices in the Given Array II problem using the Two Pointers pattern.
We'll cover the following...
We'll cover the following...
Statement
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
sstarting atimatchesa, meanings[i..i + len(a) - 1] == a.There exists an index
jsuch that the substring ofsstarting atjmatchesb, meanings[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:
...