Apexon Interview Question

Coding exercise on string on coderpad