i to 0.i until sensor1[i] is not equal to sensor2[i] or until the end of the arrays is reached.-1 as both sensors are identical.sensor1 can be aligned with sensor2 by incrementing i while sensor1[i] == sensor2[i + 1] and sensor1[i + 1] == sensor2[i].i reaches the second to last index, return -1 as the discrepancy is ambiguous.sensor1[i] == sensor2[i + 1], return 1 indicating sensor 1 is faulty.2 indicating sensor 2 is faulty.