how to implement this array algorithm in a more efficient way?
问题 Assuming I have n = 3 lists of same length for example: R1 = [7,5,8,6,0,6,7] R2 = [8,0,2,2,0,2,2] R3 = [1,7,5,9,0,9,9] I need to find the first index t that verifies the n = 3 following conditions for a period p = 2 . Edit: the meaning of period p is the number of consecutive "boxes". R1[t] >= 5, R1[t+1] >= 5 . Here t +p -1 = t+1 , we need to only verify for two boxes t and t+1 . If p was equal to 3 we will need to verify for t , t+1 and t+2 . Note that It's always the same number for which