Netskope policy components may arrive as a concatenated string. Given a string s and a dictionary of valid policy tokens, return every possible sentence formed by inserting spaces so that each resulting word appears in the dictionary.
Use memoized depth-first search or an equivalent dynamic programming strategy. Return the sentences in any order. If no complete segmentation exists, return an empty list.
Implement word_break_sentences(s, wordDict):
s is a non-empty string containing lowercase English letters.wordDict is a list of unique lowercase strings.s.def word_break_sentences(s, wordDict):