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

Автор abhikolar1512, история, 6 лет назад, По-английски

Suppose we are give two strings 'x' and 'y' of same length p (1 <= p <= 200000). Each string consists of atmost 3 distinct characters. These 3 distinct characters are same in both string. I want to find number of indices j such that x[j]=y[j] between a suffix of string 'x' of length l and prefix of string 'y' of same length l. I want to print answer for each l (1<=l<=p). For example: x : "dfgd" and Y : "gfdf". Answer for suffix of length 3 of string x and prefix of length 3 of string y is 1.I have to print answer for each l (1<=l<=p). Any suggestions?

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

»
6 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Link to the problem?