Microsoft interview question

Classic easy leetcode string question