public static void Main()
int[] arr = { 3, -4, 2, 9, 0, 7, -2, 1, 6, 5, 4 };
var result = FindIndicesOfSum(arr, target);
Console.WriteLine(new { Index1 = result[0], Index2 = result[1] });
private static int[] FindIndicesOfSum(int[] array, int target)
from x in array.Select((value, idx) => new { value, idx })
from y in array.Select((value, idx) => new { value, idx })
where (x.idx != y.idx) && ((x.value + y.value) == target)
select new[] { x.idx, y.idx };
var result = query.FirstOrDefault();