Need help to solve "Toph — Very Dirty String"

Правка en1, от I__Love__TANIA, 2018-08-07 21:35:01

Need some help to solve Very Dirty String problem.

Short Description:

Given three strings A, B and C. Find the longest common sub-sequence of A and B, which have C at-least once as a substring in it.

Input: There will be T test cases. For each test there will be three lines describing string A, B, and C.

Constraints: 1 ≤ T ≤ 100 1 ≤ |A|, |B|, |C| ≤ 100

My approach: I tried it using normal recursive LCS with extra another state pointing the index of string C i'm trying to match.

here is my code.

Sorry for my bad English.

Теги #dp, #dynamic-programming, #strings, #lcs

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский I__Love__TANIA 2018-08-07 21:35:01 665 Initial revision (published)