Amazon interview question

There is a word break problem in leet code