Skip to content

Commit 8da81b9

Browse files
committed
feat:added Word Break problem in backtracking
1 parent 3a79f33 commit 8da81b9

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Backtracking/WordBreak.js

+8
Original file line numberDiff line numberDiff line change
@@ -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+
19
export class WordBreakSolution {
210
// Function to determine if the input string 's' can be segmented into words from the 'wordDict'
311
wordBreak(s, wordDict) {

0 commit comments

Comments
 (0)