Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Linq;
- using System.Collections.Generic;
- using System.Linq.Expressions;
- using System.Text;
- namespace notTheBestSolution
- {
- class Program
- {
- public static void Main(string[] args)
- {
- string input = Console.ReadLine();
- List<char> chars = input.ToList();
- for (int i = 1; i < chars.Count; i++)
- {
- if (chars[i] == chars[i - 1])
- {
- chars.RemoveAt(i);
- i--;
- }
- }
- Console.WriteLine(string.Join("", chars));
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement