Meta Interview Question

LC Medium: Word Break problem