We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3a79f33 commit 8da81b9Copy full SHA for 8da81b9
Backtracking/WordBreak.js
@@ -1,3 +1,11 @@
1
+/**
2
+ * Determines if the input string can be segmented into words from the provided dictionary.
3
+ * @param {string} s - The input string to be segmented.
4
+ * @param {string[]} wordDict - An array of valid words for segmentation.
5
+ * @returns {boolean} True if the string can be segmented into valid words, false otherwise.
6
+ * @see https://www.geeksforgeeks.org/word-break-problem-using-backtracking/
7
+ */
8
+
9
export class WordBreakSolution {
10
// Function to determine if the input string 's' can be segmented into words from the 'wordDict'
11
wordBreak(s, wordDict) {
0 commit comments