I have a list that contains elements of different texts such that:
First element txt1
is the following text:
Analysis of coverage
Better algorithm
Strategy of random search
Second element txt2
is the following text:
Analysis of coverage
Better algorithm
Master process
Strategy of genetic search
Third element txt3
is the following text:
Analysis of coverage
Better algorithm
Master process
Strategy of genetic search
What I want is to compare each element with the previous one and detect any differences. In the case above, I want to compare txt1
with txt2
and return the following lines as they are different:
Master process
Strategy of genetic search
But when comparing txt2
and txt3
, there is no difference at all.
How can I do that?