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

Автор chirag_h, история, 4 года назад, По-английски

I was trying this problem Taklu Kuddus.

The problem gives us a string S and a pattern P and for Q queries we have to find the maximum number of non-overlapping occurrences of P in the substring of S of the given range in q.

I first tried brute force which got TLE. I tried playing with the starting and ending indexes of matched substrings but could not think of a clear strategy.

Any leads on how to approach this?

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

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