Approach hintTry it first, then revealHide
Mark every position i where s[i] == s[i+1], build prefix sums over those marks, and answer each query as the difference of two prefix values.
Mark every position i where s[i] == s[i+1], build prefix sums over those marks, and answer each query as the difference of two prefix values.