Arista Networks Interview Question

It was a coding question regarding a simple algorithm to reformat a given string.