Skip to main content
5 of 9
deleted 49 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 xibu for -5 bytes!