Goldman Sachs Interview Question

String. Use a freq array