Pergunta de entrevista da empresa Tacit Knowledge

Given two numerical arrays with almost identical elements, one array has one element more than the other, how to identify the array that has the extra element and which element is that?

Resposta da entrevista

Sigiloso

8 de fev. de 2016

Sum all elements within each array, sustract the two sums from each other. The result is the extra element, the order of the sustraction will give out clues as to which array had the extra element

1