Advertisement
Guest User

Untitled

a guest
Nov 16th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. using System;
  2. using System.Linq;
  3. using System.Collections.Generic;
  4. using System.Linq.Expressions;
  5. using System.Text;
  6.  
  7.  
  8. namespace notTheBestSolution
  9. {
  10. class Program
  11. {
  12. public static void Main(string[] args)
  13. {
  14. string input = Console.ReadLine();
  15. List<char> chars = input.ToList();
  16.  
  17. for (int i = 1; i < chars.Count; i++)
  18. {
  19. if (chars[i] == chars[i - 1])
  20. {
  21. chars.RemoveAt(i);
  22. i--;
  23. }
  24. }
  25.  
  26. Console.WriteLine(string.Join("", chars));
  27. }
  28. }
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement