Hackpads are smart collaborative documents. Join Hackpad Now.

Dken Chen

20 days ago
Unfiled. Edited by Dken Chen 20 days ago
Dken C Coding Test
Given a non-empty string s and a dictionary wordDict containing a list of non-empty words, add spaces in s to construct a sentence where each word is a valid dictionary word. Return all such possible sentences.
 
Input: s = “kaiosinc”, wordDict = [“kaios”, “inc”]
Output: true
 
Input: s = "catsandog", wordDict = ["cats", "dog", "sand", "and", "cat"]
Output: false
 
  • class Test(object):
  •     def __init__(self):
  •         pass
 
 

Contact Support



Please check out our How-to Guide and FAQ first to see if your question is already answered! :)

If you have a feature request, please add it to this pad. Thanks!


Log in / Sign up