Google Interview Question

basic string manipulation and array