Solve string and hashmap coding tasks | Goldman Sachs Interview Question