Amazon Interview Question

Given a string, perform deletion of k adjacent duplicates