employer cover photo
employer logo
employer logo

Knight Capital

Acquisita da KCG

Questa è la tua azienda?

Domanda di colloquio di Knight Capital

Given an array of N integers, find the missing integer.

Risposte di colloquio

Anonimo

5 nov 2010

the answer is subtract the sum from n*(n+1)/2

3

Anonimo

20 mar 2011

Is that a well-known algorithm? I don't know how you could ever have figured that out. I would have sorted the array and iterated until I got to the missing integer.

Anonimo

13 mag 2010

Iterate through array, keeping a sum of the values. Subtract the final answer from n*(n-1)/2

2