Word Break Problem
Problem Statement
Given a string
swordDictswordDictRules and Constraints
- The string is composed solely of lowercase English letters.
s - The input string may or may not contain spaces between words.
s - The set contains unique words composed solely of lowercase English letters.
wordDict - It is guaranteed that all characters of and all words in
sare valid English letters.wordDict - The words in may be of varying lengths.
wordDict - Each word in corresponds to a valid English word.
wordDict - The set is not empty, and it does not contain the empty string.
wordDict - The function should return if
truecan be segmented into a sequence of words ins, andwordDictotherwise.false
Output Requirements
- Return a boolean value (or
true) indicating whetherfalsecan be segmented into a sequence of words ins.wordDict
Example
Input: {"input_data":[1,2,3]} Output: [1,2,3]
CompaniesGoogleMetaAmazon
JavaScript
Login to write code
Solve problems, verify your skills, and earn XP.