Facebook | screening | find pairs a[i] + b[j] = a[j] + b[i], i >= j

Difficulty: EASYCategory: InterviewExperienceFrequency: 1Asked On 2022-02-03Added By Anonymous
Source: Link

Company: Meta (Facebook)
Role: e3, e4
Interview Stage: Screening
Location: unknown
Year: unknown

Original Post Content:

How would you solve this without brute force?

Find the number of pairs: a[i] + b[j] = a[j] + b[i], i >= j
a = []int{25,0}
b = []int{0,25}

Result = 3

Comments