← Walmart questions

Two Elements with Sum Equal to S

Filed under Walmart

Given a target sum S and an array of n numbers, find two elements in the array whose sum equals S. Return their indices, expecting an O(n log n) time complexity.

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

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