Accenture interview question

Create a function that creates a compressed string based on the repeating consecutive characters in an input string.