removed lcs uitl

This commit is contained in:
Somdev Sangwan
2021-04-26 18:59:40 +05:30
committed by GitHub
parent dfec99693d
commit 362b8a1c02

View File

@@ -19,25 +19,6 @@ import arjun.core.config as mem
from arjun.core.colors import info
def lcs(s1, s2):
"""
finds longest common substring between two strings
returns str
"""
m = [[0] * (1 + len(s2)) for i in range(1 + len(s1))]
longest, x_longest = 0, 0
for x in range(1, 1 + len(s1)):
for y in range(1, 1 + len(s2)):
if s1[x - 1] == s2[y - 1]:
m[x][y] = m[x - 1][y - 1] + 1
if m[x][y] > longest:
longest = m[x][y]
x_longest = x
else:
m[x][y] = 0
return s1[x_longest - longest: x_longest]
def extract_headers(headers):
"""
parses headers provided through command line