Created
May 6, 2015 11:55
-
-
Save EBojilova/82c8b95a8b38358109b6 to your computer and use it in GitHub Desktop.
04. Sequences of Equal Strings
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.Collections.Generic; | |
using System.Linq; | |
class SequencesEqualStrings | |
{ | |
static void Main(string[] args) | |
{ | |
string[] input = Console.ReadLine().Split(' '); | |
var groups = input.GroupBy(name => name); | |
foreach (var group in groups) | |
{ | |
Console.WriteLine(string.Join(" ",group)); | |
} | |
Console.WriteLine(); | |
} | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment