code for Word Break II