Razorpay interview question

Remove Consecutive Duplicate Pairs from String