String Matching

Revision en3, by abhikolar1512, 2018-06-15 20:23:52

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?

Tags string algorithms, string, similarity

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English abhikolar1512 2018-06-15 20:23:52 19 Tiny change: 'e length p. Each str' -> 'e length p (1 <= p <= 200000). Each str'
en2 English abhikolar1512 2018-06-15 20:21:18 18
en1 English abhikolar1512 2018-06-15 20:20:39 553 Initial revision (published)