← MakeMyTrip questions

Print all pairs with a given sum from two arrays

Filed under MakeMyTrip

Given two arrays and a target sum K, find and print all pairs consisting of one element from the first array and one element from the second array whose sum equals K.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related MakeMyTrip questions

Collected from public candidate posts and coding forums. Updated Nov 2026.