3297. Count Substrings That Can Be Rearranged to Contain a String I
You are given two strings
word1
andword2
.A string
x
is called valid ifx
can be rearranged to haveword2
as a prefix.Return the total number of valid substrings of
word1
.
c++
1 |
|