Google interview question

String manipulation questions. I'd say equivalent to Leetcode 'medium' level difficulty.