Challenge 10: Find Two Numbers that Add Up to "Value"
Explore how to implement a function in C# that finds two numbers within an array whose sum equals a given value. Understand the use of hash sets for efficient lookups and optimize your solution beyond brute force methods.
We'll cover the following...
We'll cover the following...
Problem statement
Implement a function int[] findSum(int[] arr, int sum, int size) which takes an array arr, a number value, size of the array as input, and returns an array of two numbers that add up to value. In case there is more than one pair in the array containing numbers that add up ...