Private List<string> removeDuplicates(List<string> inputList) {
Dictionary<string, int> uniqueStore = new Dictionary<string, int>();
List<string> finalList = new List<string>();
foreach (string currValue in inputList) {
if (!uniqueStore.ContainsKey(currValue)) {
uniqueStore.Add(currValue, 0);
finalList.Add(currValue);
}
}
return finalList;
}
No comments:
Post a Comment