longest-substring

How to print the longest sentence from a column in a csv file

How to print the longest sentence from a column in a csv file Question: I am very new to python and am really struggling with this problem. I have a csv file with different columns, labeled "height" "weight" "full_name" etc. I’m trying to create a function that will look through the full_name column and return …

Total answers: 2

Find multiple longest common leading substrings with length >= 4

Find multiple longest common leading substrings with length >= 4 Question: In Python I am trying to extract all the longest common leading substrings that contain at least 4 characters from a list. For example, in the list called “data” below, the 2 longest common substrings that fit my criteria are “johnjack” and “detc”. I …

Total answers: 2

this code in python about finding the longest sub-string , i need explaination

this code in python about finding the longest sub-string , i need explaination Question: i am trying to understand how this code works behind the scene , help appreciated explain this part please: MAX = ACCOUNT if len(ACCOUNT) > len(MAX) else MAX ACCOUNT = ACCOUNT + c if c >= ACCOUNT[-1] else c ================================================ S …

Total answers: 1

Python: Length of longest common subsequence of lists

Python: Length of longest common subsequence of lists Question: Is there a built-in function in python which returns a length of longest common subsequence of two lists? a=[1,2,6,5,4,8] b=[2,1,6,5,4,4] print a.llcs(b) >>> 3 I tried to find longest common subsequence and then get length of it but I think there must be a better solution. …

Total answers: 1

Longest common substring from more than two strings

Longest common substring from more than two strings Question: I’m looking for a Python library for finding the longest common sub-string from a set of strings. There are two ways to solve this problem: using suffix trees using dynamic programming. Method implemented is not important. It is important it can be used for a set …

Total answers: 10