{
Dictionary
if (string.IsNullOrEmpty(inputString))
{
throw new NullReferenceException();
}
for (int i = 0; i < inputString.Length; i++)
{
if (charactersDictinary.ContainsKey(inputString[i]))
{
i++;
}
else
{
charactersDictinary.Add(inputString[i], i);
}
}
return charactersDictinary.Count;
}
No comments:
Post a Comment