During an interview today I was asked to write a function that accepted an array of integers and return the positions of two values in the array that the sum was 10.My code wasC#public string ReturnIntegers(int[] arrayOfIntegers){   for(int j = 0; j < arrayOfIntegers.Length - 1; j++)   {      for(int k = j + 1; k < arrayOfIntegers.Length; k++)      {          sum = arrayOfIntegers[j] + arrayOfIntegers[k];          if(sum == 10)             return j + , + k;      }}Assuming the array entered has more than 2 values. My interviewer said that this had a magnitude of n^2 if the array contained a billion values. What is a better solution (performance) to support a large number of values.
Searching for 2 numbers that equal 10
c#;code quality;code reviews