Stream_Cipher's blog

By Stream_Cipher, history, 3 years ago, In English

I write a nlogn solution for this problem but it is giving tle how to solve this using KMP or other string matching algorithm. Help will be really appreciated . Thanks :)

  • Vote: I like it
  • -2
  • Vote: I do not like it

| Write comment?
»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

the problem can solved in O(n) time using the z-function

»
3 years ago, # |
  Vote: I like it 0 Vote: I do not like it

you can use string hashing.

my submission