Skip to main content
Code update
Source Link
Destroigo
  • 411
  • 2
  • 6

C# (.NET Core), 231, 203, 200, 196196, 192 bytes

EDIT: Function is now at 185 bytes plus 18 for using System.Linq;

Thanks to BMO (for 1>0 being equal to true plus newline removal) and Mr. XCoder (for f=!f statements)!

EDIT2: Down to 182 bytes plus 18 for using System.Linq thanks to dana for sharing a few golf tips!

EDIT3: Thanks to Embodiment of Ignorance for the int[] -> var, removal of short circuit && -> &, and changing up ToArray -> ToList! (178 bytes + 18 using)

EDIT4: Embodiment of Ignorance dropped 4 bytes by changing an assignment. Dummy me shoulda counted! Thanks again :D

p=>{var f=1>0;while(f){var t=p.Select(n=>n-48).ToList();p="";f=!f;var h=t.Count;forf;for(var j=0;j<h;j++j=0;j<t.Count;j++){if(j<hj<t.Count-1&t[j]==t[1+j]){p+=t[j]+t[1+j++];f=p+=t[j]+t[++j];f=!f;continue;}p+=t[j];}};return p;};

Try it online!Try it online!

C# (.NET Core), 231, 203, 200, 196 bytes

EDIT: Function is now at 185 bytes plus 18 for using System.Linq;

Thanks to BMO (for 1>0 being equal to true plus newline removal) and Mr. XCoder (for f=!f statements)!

EDIT2: Down to 182 bytes plus 18 for using System.Linq thanks to dana for sharing a few golf tips!

EDIT3: Thanks to Embodiment of Ignorance for the int[] -> var, removal of short circuit && -> &, and changing up ToArray -> ToList! (178 bytes + 18 using)

p=>{var f=1>0;while(f){var t=p.Select(n=>n-48).ToList();p="";f=!f;var h=t.Count;for(var j=0;j<h;j++){if(j<h-1&t[j]==t[1+j]){p+=t[j]+t[1+j++];f=!f;continue;}p+=t[j];}};return p;};

Try it online!

C# (.NET Core), 231, 203, 200, 196, 192 bytes

EDIT: Function is now at 185 bytes plus 18 for using System.Linq;

Thanks to BMO (for 1>0 being equal to true plus newline removal) and Mr. XCoder (for f=!f statements)!

EDIT2: Down to 182 bytes plus 18 for using System.Linq thanks to dana for sharing a few golf tips!

EDIT3: Thanks to Embodiment of Ignorance for the int[] -> var, removal of short circuit && -> &, and changing up ToArray -> ToList! (178 bytes + 18 using)

EDIT4: Embodiment of Ignorance dropped 4 bytes by changing an assignment. Dummy me shoulda counted! Thanks again :D

p=>{var f=1>0;while(f){var t=p.Select(n=>n-48).ToList();p="";f=!f;for(var j=0;j<t.Count;j++){if(j<t.Count-1&t[j]==t[1+j]){p+=t[j]+t[++j];f=!f;continue;}p+=t[j];}};return p;};

Try it online!

deleted 97 characters in body
Source Link
Destroigo
  • 411
  • 2
  • 6

C# (.NET Core), 231, 203, 200200, 196 bytes

EDIT: Function is now at 185 bytes plus 18 for using System.Linq;

Thanks to BMO (for 1>0 being equal to true plus newline removal) and Mr. XCoder (for f=!f statements)!

EDIT2: Down to 182 bytes plus 18 for using System.Linq thanks to dana for sharing a few golf tips!

EDIT3: Thanks to Embodiment of Ignorance for the int[] -> var, removal of short circuit && -> &, and changing up ToArray -> ToList! (178 bytes + 18 using)

p=>{var f=1>0;while(f){int[]t=pvar t=p.Select(n=>n-48).ToArrayToList();p="";f=!f;var h=t.Length;forCount;for(var j=0;j<h;j++){if(j<h-1&&t[j]==t[1+j]1&t[j]==t[1+j]){p+=t[j]+t[1+j++];f=!f;continue;}p+=t[j];}};return p;};

[Try it online!][TIO-jqfl5h09]

[TIO-jqfl5h09]: https://tio.run/##TZAxa8MwEIV3/wrVQ5BQYxLokHCRoRQ6pVBIoUPqwVHlWMY5udI5JRj/dtduMoQb3r33uG84HebaeTO0weKR7S6BzAmie5dsLf5ApOs8BPbu3dHnpy5irGkPtdUsUE6jnJ39Zm@5RS6mkrHXFvUmkB9Bj1dJ2YGpoVFpd849K9QyXcBvaWvDC9FZpH1Gqkl2pjaaOKoU508rkXy4Z@/zCxfQqDiGQj0UMN2XipKtwSOVUDjPp6hSC6g2JVRSjsCCj/t8OZvRvsqUov1SVpnoGqmmQP57KbMrUTski62B/tZD34M31HpkDfQw3H7x4jC42iSf3pLhBx6v16tVLGT8hbGAqB9n@AM "C# (.NET Core) – Try It Online"KdJLs5@sdfcIhdzydhLh3oXyE@gx5ukrGBqbFXaX3LPSrVOV/BT2cbwUvQW6ZiRapODaYwmjirF5WYrknf35H1@5QJaFcdQqocS5vtKUbI3eKIKSuf5HNVqBfWuglrKCVjyaV@uFws61plSdFzLOhN9K9UcyD8vZXYjaodksTMw3HsYBvCGOo@shQHG@y@eHQbXmOTDWzK84PFms93GQsafGAuIhmnGXw "C# (.NET Core) – Try It Online"Try it online!

C# (.NET Core), 231, 203, 200 bytes

EDIT: Function is now at 185 bytes plus 18 for using System.Linq;

Thanks to BMO (for 1>0 being equal to true plus newline removal) and Mr. XCoder (for f=!f statements)!

EDIT2: Down to 182 bytes plus 18 for using System.Linq thanks to dana for sharing a few golf tips!

p=>{var f=1>0;while(f){int[]t=p.Select(n=>n-48).ToArray();p="";f=!f;var h=t.Length;for(var j=0;j<h;j++){if(j<h-1&&t[j]==t[1+j]){p+=t[j]+t[1+j++];f=!f;continue;}p+=t[j];}};return p;};

[Try it online!][TIO-jqfl5h09]

[TIO-jqfl5h09]: https://tio.run/##TZAxa8MwEIV3/wrVQ5BQYxLokHCRoRQ6pVBIoUPqwVHlWMY5udI5JRj/dtduMoQb3r33uG84HebaeTO0weKR7S6BzAmie5dsLf5ApOs8BPbu3dHnpy5irGkPtdUsUE6jnJ39Zm@5RS6mkrHXFvUmkB9Bj1dJ2YGpoVFpd849K9QyXcBvaWvDC9FZpH1Gqkl2pjaaOKoU508rkXy4Z@/zCxfQqDiGQj0UMN2XipKtwSOVUDjPp6hSC6g2JVRSjsCCj/t8OZvRvsqUov1SVpnoGqmmQP57KbMrUTski62B/tZD34M31HpkDfQw3H7x4jC42iSf3pLhBx6v16tVLGT8hbGAqB9n@AM "C# (.NET Core) – Try It Online"KdJLs5@sdfcIhdzydhLh3oXyE@gx5ukrGBqbFXaX3LPSrVOV/BT2cbwUvQW6ZiRapODaYwmjirF5WYrknf35H1@5QJaFcdQqocS5vtKUbI3eKIKSuf5HNVqBfWuglrKCVjyaV@uFws61plSdFzLOhN9K9UcyD8vZXYjaodksTMw3HsYBvCGOo@shQHG@y@eHQbXmOTDWzK84PFms93GQsafGAuIhmnGXw "C# (.NET Core) – Try It Online"

C# (.NET Core), 231, 203, 200, 196 bytes

EDIT: Function is now at 185 bytes plus 18 for using System.Linq;

Thanks to BMO (for 1>0 being equal to true plus newline removal) and Mr. XCoder (for f=!f statements)!

EDIT2: Down to 182 bytes plus 18 for using System.Linq thanks to dana for sharing a few golf tips!

EDIT3: Thanks to Embodiment of Ignorance for the int[] -> var, removal of short circuit && -> &, and changing up ToArray -> ToList! (178 bytes + 18 using)

p=>{var f=1>0;while(f){var t=p.Select(n=>n-48).ToList();p="";f=!f;var h=t.Count;for(var j=0;j<h;j++){if(j<h-1&t[j]==t[1+j]){p+=t[j]+t[1+j++];f=!f;continue;}p+=t[j];}};return p;};

Try it online!

Golfing
Source Link
Destroigo
  • 411
  • 2
  • 6

C# (.NET Core), 231, 203, 203, 200 bytes

EDIT: Function is now at 185 bytes plus 18 for Usingusing System.Linq;

Thanks to BMO (for 1>0 being equal to true plus newline removal) and Mr. XCoder (for f=!f statements)!

EDIT2: Down to 182 bytes plus 18 for using System.Linq thanks to dana for sharing a few golf tips!

p=>{boolvar f=1>0;while(f){int[]t=p.Select(n=>n-'0'48).ToArray();p="";f=!f;var h=t.Length;for(var j=0;j<h;j++){if(j<h-1&&t[j]==t[j+1]1&&t[j]==t[1+j]){p+=t[j]+t[j+1];j++;f=p+=t[j]+t[1+j++];f=!f;continue;}p+=t[j];}};return p;};

Try it online! [Try it online!][TIO-jqfl5h09]

[TIO-jqfl5h09]: https://tio.run/##TZAxa8MwEIV3/wrVQ5BQYxLokHCRoRQ6pVBIoUPqwVHlWMY5udI5JRj/dtduMoQb3r33uG84HebaeTO0weKR7S6BzAmie5dsLf5ApOs8BPbu3dHnpy5irGkPtdUsUE6jnJ39Zm@5RS6mkrHXFvUmkB9Bj1dJ2YGpoVFpd849K9QyXcBvaWvDC9FZpH1Gqkl2pjaaOKoU508rkXy4Z@/zCxfQqDiGQj0UMN2XipKtwSOVUDjPp6hSC6g2JVRSjsCCj/t8OZvRvsqUov1SVpnoGqmmQP57KbMrUTski62B/tZD34M31HpkDfQw3H7x4jC42iSf3pLhBx6v16tVLGT8hbGAqB9n@AM "C# (.NET Core) – Try It Online"KdJLs5@sdfcIhdzydhLh3oXyE@gx5ukrGBqbFXaX3LPSrVOV/BT2cbwUvQW6ZiRapODaYwmjirF5WYrknf35H1@5QJaFcdQqocS5vtKUbI3eKIKSuf5HNVqBfWuglrKCVjyaV@uFws61plSdFzLOhN9K9UcyD8vZXYjaodksTMw3HsYBvCGOo@shQHG@y@eHQbXmOTDWzK84PFms93GQsafGAuIhmnGXw "C# (.NET Core) – Try It Online"

C# (.NET Core), 231, 203 bytes

EDIT: Function is now at 185 bytes plus 18 for Using System.Linq;

Thanks to BMO (for 1>0 being equal to true plus newline removal) and Mr. XCoder (for f=!f statements)!

p=>{bool f=1>0;while(f){int[]t=p.Select(n=>n-'0').ToArray();p="";f=!f;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=!f;continue;}p+=t[j];}};return p;}

Try it online!

C# (.NET Core), 231, 203, 200 bytes

EDIT: Function is now at 185 bytes plus 18 for using System.Linq;

Thanks to BMO (for 1>0 being equal to true plus newline removal) and Mr. XCoder (for f=!f statements)!

EDIT2: Down to 182 bytes plus 18 for using System.Linq thanks to dana for sharing a few golf tips!

p=>{var f=1>0;while(f){int[]t=p.Select(n=>n-48).ToArray();p="";f=!f;var h=t.Length;for(var j=0;j<h;j++){if(j<h-1&&t[j]==t[1+j]){p+=t[j]+t[1+j++];f=!f;continue;}p+=t[j];}};return p;};

[Try it online!][TIO-jqfl5h09]

[TIO-jqfl5h09]: https://tio.run/##TZAxa8MwEIV3/wrVQ5BQYxLokHCRoRQ6pVBIoUPqwVHlWMY5udI5JRj/dtduMoQb3r33uG84HebaeTO0weKR7S6BzAmie5dsLf5ApOs8BPbu3dHnpy5irGkPtdUsUE6jnJ39Zm@5RS6mkrHXFvUmkB9Bj1dJ2YGpoVFpd849K9QyXcBvaWvDC9FZpH1Gqkl2pjaaOKoU508rkXy4Z@/zCxfQqDiGQj0UMN2XipKtwSOVUDjPp6hSC6g2JVRSjsCCj/t8OZvRvsqUov1SVpnoGqmmQP57KbMrUTski62B/tZD34M31HpkDfQw3H7x4jC42iSf3pLhBx6v16tVLGT8hbGAqB9n@AM "C# (.NET Core) – Try It Online"KdJLs5@sdfcIhdzydhLh3oXyE@gx5ukrGBqbFXaX3LPSrVOV/BT2cbwUvQW6ZiRapODaYwmjirF5WYrknf35H1@5QJaFcdQqocS5vtKUbI3eKIKSuf5HNVqBfWuglrKCVjyaV@uFws61plSdFzLOhN9K9UcyD8vZXYjaodksTMw3HsYBvCGOo@shQHG@y@eHQbXmOTDWzK84PFms93GQsafGAuIhmnGXw "C# (.NET Core) – Try It Online"

Added corrections.
Source Link
Destroigo
  • 411
  • 2
  • 6
Loading
Source Link
Destroigo
  • 411
  • 2
  • 6
Loading