Microsoft interview question

To answer a coding challenge