Microsoft interview question

leetcode easy, basic string manipulation