Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
C GCC, 4140 bytes
f(int*a){*a=*a^*++aa=*a^*++a?a[-(*a==a[1])]:f(a);}
Try it online!Try it online!
Thanks to xibu for -5 bytes!
Thanks to ceilingcat for -1 byte2 bytes!
C GCC, 41 bytes
f(int*a){*a=*a^*++a?a[-(*a==a[1])]:f(a);}
Try it online!
Thanks to ceilingcat for -1 byte!
C GCC, 40 bytes
f(int*a){a=*a^*++a?a[-(*a==a[1])]:f(a);}
Thanks to ceilingcat for -2 bytes!
C GCC, 4241 bytes
r;ff(int*a){r=*a^*++a*a=*a^*++a?a[-(*a==a[1])]:f(a);}
C GCC, 42 bytes
r;f(int*a){r=*a^*++a?a[-(*a==a[1])]:f(a);}
C GCC, 4342 bytes
r;f(int*a){r=*a^a[1]r=*a^*++a?a[a[1]!=a[2]]a[-(*a==a[1])]:f(a+1a);}
C GCC, 43 bytes
r;f(int*a){r=*a^a[1]?a[a[1]!=a[2]]:f(a+1);}