Pergunta de entrevista da empresa Intel Corporation

write a function that gets array and a number and check if there are 2 elements in the array that their sum is equal to the given number

Resposta da entrevista

Sigiloso

19 de mai. de 2022

Classic Leetcode Two Sum, here is a python solution Lookup = {} lookup = {} for i in range(len(nums)): if nums[i] in lookup: return [lookup[nums[i]], i] else: lookup[target - nums[i]] = i return None