Amazon interview question

cleaning robot problem