Domanda di colloquio di Google

Question based on array and vectors and then optimization.