How would you check if an array has two numbers summing to X?
Task
Given an array of integers and a number target, are there two distinct elements that sum to target? Return their indices.
The rest of this answer, with code and interview follow-ups, is in the DevPrep app.
Read the full answer in DevPrep