Google interview question

One string problem and one backtracking problem