using System.Collections.Generic;
using System.Collections;
public static void Main()
var array = new int[] {1, 4, 5, 3, 2};
public static void PrintTwoSum(int[] array, int sum)
var hashtable = new Hashtable();
for (int i = 0; i < array.Length; i++) {
int complement = sum - array[i];
if (hashtable.ContainsKey(complement))
return new int[] { hashtable[i], i };
hashtable.Add(array[i], i);