Amazon interview question

It was some leet code medium question