Skip to main content
1 of 2

#PHP, 74 bytes

function c(&$a){foreach($a as$k=>$v)$a[$k+1]===$v&&array_splice($a,$k,2);}

Function c calls by reference to reduce array. Try it online.

Interestingly this works in Php5.6 but not 7.