comparing two serial outputs using arduino

i want to compare two sets of the serial outputs that comes from my circuit using arduino

To explain more .. i want to measure the output of a photodiode for a specific time

firstly how to tell arduino to get the output values for only 1 minutes for example to get the first serial ..?

then do the measurement again for 1 minutes also to get the second serial..?

then after that compare this two serial and tell the percentages of matching between this two serial

for example if i have this two serials outputs:
first " 1 , 2 , 3, 4 , 5 , 6 ,7 , 8 , 9 , 10 "
second " 0, 2 , ,3 ,7 ,8 ,6 ,7, 8, 10 ,11"

as we can see here only { 2, 3, 6,7,8} are match i would like to say that the percentage of matching is 50% only because order is important as well to calculate the percentage of matching

what should be the arduino code for this situation ?

thanks in advance

It sounds as if you want to compare two sequences of values. The best way to do that depends on what sort of values you're dealing with. Are these values digital states (HIGH/LOW), or counters, or analog input values? How many will there be?