Paycom Interview Question

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

Interview Answer

Anonymous

Mar 21, 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