Goldman Sachs Interview Question

One Dp question One String sorting question