Changed s.ToLower() → s.ToUpperInvariant(), fitting msdn recommended best practices for strings.
using System; using System.Linq; public class Kata { public static int DuplicateCount(string s) => s.ToUpperInvariant() .GroupBy(c => c) .Count(g => g.Skip(1).Any()); }
- 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());- s.ToUpperInvariant()
- .GroupBy(c => c)
- .Count(g => g.Skip(1).Any());
- }