Use group discussion to help students figure out boundary cases for removing duplicate adjacent elements on their own so that they get to discuss a variety of test cases in depth before focusing on the code.
Have students code boundary condition test to handle removing adjacent duplicates to help them better understand data structures and become familiar with common bugs through practice.