You are given a string with lengthnnn, and the size of the alphabet also isnnn. There areqqqqueries. For a query, you are given two integersl,rl,rl,rand you need to answer the number of different strings that can be obtained by removing a substring containing[l,r][l,r][l,r].
You are given a string with length nnn, and the size of the alphabet also is nnn. There are qqq queries. For a query, you are given two integers l,rl,rl,r and you need to answer the number of different strings (which can be empty) that can be obtained by removing a substring containing [l,r][l,r][l,r].
(图片来源网络,侵删)