You are given a string s and a queries where queries[i]
A same end substring is a substring whose first character and last character are identical.
For each query, determine the number of same end substrings contained within the substring extending from index
Return an array of integers representing the answer to each query in the order they appear.
Constraints:
s.length
s consists only of lowercase English letters.
queries.length
queries[i]
s.length
You are given a string s and a queries where queries[i]
A same end substring is a substring whose first character and last character are identical.
For each query, determine the number of same end substrings contained within the substring extending from index
Return an array of integers representing the answer to each query in the order they appear.
Constraints:
s.length
s consists only of lowercase English letters.
queries.length
queries[i]
s.length