Back to problems

Word Break

Algorithm · Uber · Medium

Requirements Input: a string s together with a list or set named wordDict. Decide whether s can be partitioned into a sequence containing at least one word from the dictionary. A dictionary entry is allowed to appear more than once in the partition. Return false if it is impossible to split the whole string into dictionary words. Examples Input: s = "blueblue", wordDict = ["blue", "sky"] Output: true Explanation: The string can be split as "blue" + "blue", so reusing "blue"…

Checking your access…