Блог пользователя ideservebetter

Автор ideservebetter, история, 14 месяцев назад, По-английски

Problem Link

You're given a string S consisting of N lowercase English characters. A string is considered good if it can be rearranged to form a palindrome.

There are Q Queries, Each query contains two integers, l and r, representing a range within the string S. For each query, determine the number of good substrings within the inclusive range [l, r].

How can we solve this problem ? The issue im facing is that if [l, r] can be shuffled to be a palindrome, [l + 1, r] not necessarily can be shuffled. Hence not able to precompute some answers.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +7
  • Проголосовать: не нравится