Microsoft interview question

leetcode question medium about arry and string