Skip to interview prep
Apexed

Given arrays A and B of size n, how do you find a ∈ A and b ∈ B with a + b = K in O(n log n)? How does this extend to three arrays?

Content review

Report an error

Not yet reviewed

Data structures & algorithms245 of 395

MediumSorting

Technical

This is ungraded practice. Run your solution and compare it with the model answer. Your drafts are saved in this browser.

Tab indents · Ctrl/⌘ + Enter runs · Esc then Tab leaves the editor

Press Run to see your program’s output.

Given arrays A and B of size n, how do you find a ∈ A and b ∈ B with a + b = K in O(n log n)? How does this extend to three arrays — Data structures & algorithm