You are given an integer $$$N$$$, and a string $$$S$$$ of length $$$N$$$ that only contains W
and L
. How many substrings $$$[l,r]$$$ in $$$S$$$ that satisfies:
$$$S_l=S_r=\texttt{W}$$$
The value of the count of
W
in $$$S_{[l,r]}$$$ minus the count ofL
in $$$S_{[l,r]}$$$ is greater than or equal to $$$K$$$ ($$$K$$$ is an integer and $$$K>0$$$).