Pergunta de entrevista da empresa Paycom

Given a sorted array, determine if there are two numbers that add to a given sum.

Resposta da entrevista

Sigiloso

21 de mar. de 2022

def hasArrayTwoCandidates(A, arr_size, sum): # sort the array quickSort(A, 0, arr_size-1) l = 0 r = arr_size-1 # traverse the array for the two elements while l