MCPcopy Create free account
hub / github.com/austingebauer/go-leetcode / wordBreakHelper

Function wordBreakHelper

word_break_139/solution.go:46–60  ·  view source on GitHub ↗
(s string, wordDictSet map[string]bool, start int)

Source from the content-addressed store, hash-verified

44}
45
46func 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}

Callers 1

wordBreak0Function · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected