using System;
using System.Collections.Generic;
class Program
{
public static void addToSet(int[] arr, HashSet<int> hset) {
for (int i = 0; i < arr.Length; i++) {
hset.Add(arr[i]);
}
}
static void Main() {
int[] arr = {1, 5, 7, 3, 9, 8, 0, 2};
HashSet<int> hset = new HashSet<int>();
addToSet(arr, hset);
foreach (var item in hset) {
Console.Write(item + " ");
}
}
}
/*
run:
1 5 7 3 9 8 0 2
*/