Goldman Sachs Interview Question

Related to string manipulation, arrays and maps