Skip to main content
1 of 5
Destroigo
  • 411
  • 2
  • 6

C# (.NET Core), 231 bytes

Must have:Using System.Linq; which takes it from 214 -> 231 bytes.

Utilizes a string input/output.

p=>{bool f=true;while(f){int[] t=p.Select(n=>(n-'0')).ToArray();p="";f=false;var h=t.Length;for(var j=0;j<h;j++){if(j<h-1&&t[j]==t[j+1]){p+=t[j]+t[j+1];j++;f=true;continue;}p+=t[j];}}System.Console.Write(p+"\n");}

Try it online!

Destroigo
  • 411
  • 2
  • 6