[알고리즘] LCS(Longest Common Subsequence) with Python
Longest Common Substring을 하다가 함께 해본 예제. 그래서 코드만 간단히 올린다. def extractMarkedText(target_text, compare_text): #: 입력된 두개의 인자를 가지고 테이블을 만들기 width = len(target_text) + 1 height = len(compare_text) + 1 # 테이블 초기화 빈값으로 초기화시키기 table = [''] * width * height def getTable(r, c): return table[r * width + c] def setTable(r, c, value): table[r * width + c] = value for i in range(1, height): for j in range(1, wi..