Goldman Sachs Interview Question

My coderpad consisted of 2 questions, one was string manipulation problem and other was a BFS problem.