Skip to main content
6 of 9
added 3 characters in body

C GCC, 43 bytes

r;f(int*a){r=*a^a[1]?a[a[1]!=a[2]]:f(a+1);}

Try it online!

Thanks to xibu for -5 bytes!