Pergunta de entrevista da empresa Arista Networks

Find the missing number in an array, most difficult part was optimizing the solution which I didn't manage on time. Still I learned a lot and was pretty happy to try.