Pergunta de entrevista da empresa NVIDIA

Given an array and a value, how can you determine if there are two elements in the array sum up to the value?

Resposta da entrevista

Sigiloso

20 de dez. de 2021

At first, nested loop - too easy Then asked to upgrade the solution - use of dictionary would solve the problem - everytime we scan an element we store in dictionary the element and its complement value to the given sum