Given a string s and a dictionary of strings wordDict, return true if s can be segmented into a space-separated sequence of one or more dictionary words.
Input: s = "leetcode", wordDict = ["leet","code"]
Output: true
Topics: dp, hash-map
Asked by: Amazon, Google, Meta, Microsoft, Apple, Bloomberg
Time complexity: O(n²). Space complexity: O(n).