using System;
using System.Collections.Generic;
class Program
{
public static List<string> RemoveDuplicates(List<string> list) {
var result = new List<string>();
var set = new HashSet<string>();
for (int i = 0; i < list.Count; i++) {
if (!set.Contains(list[i])) {
result.Add(list[i]);
set.Add(list[i]);
}
}
return result;
}
static void Main()
{
var list = new List<string>() { "a", "b", "b", "a", "c", "b", "b", "c", "c", "d" };
list = RemoveDuplicates(list);
Console.WriteLine(string.Join(" ", list));
}
}
/*
run:
a b c d
*/