Last active
January 26, 2017 14:22
-
-
Save erickgirard/d79b705964d105b68ad5954ec90f5449 to your computer and use it in GitHub Desktop.
Civic address problem
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Linq; | |
namespace ConsoleApplication1 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var numbers = new[] { "1425", "33133", "3587", "2080" }; | |
var numberGroups = string.Join("", numbers).ToCharArray().GroupBy(key => key); | |
foreach (var group in numberGroups) | |
{ | |
Console.WriteLine($"{group.Key} Count: {group.Count()}"); | |
} | |
Console.ReadKey(); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment