PwC interview question

DSA problem on string and array Project discussion with follow up questions