Ad
Code
Diff
  • using System;
    using System.Linq;
    
    public class Kata
    {
        public static int DuplicateCount(string s) => 
            s.ToLower()
                .GroupBy(c => c)
                .Count(g => g.Skip(1).Any());
    }
    • using System;
    • using System.Linq;
    • public class Kata
    • {
    • public static int DuplicateCount(string str)
    • {
    • return str
    • .ToLower()
    • .GroupBy(c => c)
    • .Count (g => g.Count () > 1);
    • }
    • public static int DuplicateCount(string s) =>
    • s.ToLower()
    • .GroupBy(c => c)
    • .Count(g => g.Skip(1).Any());
    • }