yamxxopd
yndfyamxx
Output: 5
I am not quite sure how to find the number of the most amount of shared characters between two strings. For example (the strings above) the most amount of characters shared together is "yamxx" which is 5 characters long.
xx would not be a solution because that is not the most amount of shared characters. In this case the most is yamxx which is 5 characters long so the output would be 5.
I am quite new to python and stack overflow so any help would be much appreciated!
Note: They should be the same order in both strings
y n d f y a m x x
, the longest match is1 0 1 0 5 4 3 2 1
. The maximum is5
so you report the substring that occurs there (y a m x x
). – Mateen Ulhaq Oct 24 '20 at 5:03