employer cover photo
employer logo

Pergunta de entrevista da empresa Altera

find a missing element in array B compare to array A.

Respostas da entrevista

Sigiloso

14 de dez. de 2013

Kevin's solutions works for small integers/arrays when the summation process does not overflow. The more general solutions is to "xor" all the objects (be them integers or more general structures) in A and B together, and the resulting object will be the value of the missing object.

4

Sigiloso

25 de mar. de 2013

You can sum up two arrays, and the difference is the missing element.

Sigiloso

14 de nov. de 2018

xor all the element in two array

Sigiloso

4 de fev. de 2016

Sort the two arrays and then match A(i) to B(i) until the don`t match.