← Cognizant questions

Find two numbers with specific sum and print distinct numbers

Filed under Cognizant

Given an unsorted array of integers and a target sum, find all unique pairs of numbers that add up to the target sum in O(n) time.

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 Cognizant questions

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