Answers for "Count the Number of Duplicate Characters"

C#
0

Count the Number of Duplicate Characters

using System.Linq;

public class Program
{
    public static int DuplicateCount(string str)
    {
			return str.ToCharArray()
				.GroupBy(x => x)
				.Where(x => x.Count() > 1)
				.Count();
    }
}
Posted by: Guest on July-19-2021

Code answers related to "Count the Number of Duplicate Characters"

C# Answers by Framework

Browse Popular Code Answers by Language