Function
wordBreakHelper
(s string, wordDictSet map[string]bool, start int)
Source from the content-addressed store, hash-verified
| 44 | } |
| 45 | |
| 46 | func wordBreakHelper(s string, wordDictSet map[string]bool, start int) bool { |
| 47 | // if we've reached the start of s, the string has been broken up |
| 48 | if start == len(s) { |
| 49 | return true |
| 50 | } |
| 51 | |
| 52 | // for each character in s |
| 53 | for i := start; i <= len(s); i++ { |
| 54 | if wordDictSet[s[start:i]] && wordBreakHelper(s, wordDictSet, i) { |
| 55 | return true |
| 56 | } |
| 57 | } |
| 58 | |
| 59 | return false |
| 60 | } |
Tested by
no test coverage detected