From 47bbc2a16e28ed92aab5269fc390de3ee16e3b16 Mon Sep 17 00:00:00 2001 From: Anushka Verma Date: Mon, 24 Aug 2020 01:54:17 +0530 Subject: [PATCH] remove word break --- backtracking/word_break.cpp | 50 ------------------------------------- 1 file changed, 50 deletions(-) delete mode 100644 backtracking/word_break.cpp diff --git a/backtracking/word_break.cpp b/backtracking/word_break.cpp deleted file mode 100644 index b41a6aa7..00000000 --- a/backtracking/word_break.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/** - * @file Word Break - * - * @details - * Given a valid sentence without any spaces between the words and - * a dictionary of valid English words, find all possible ways to - * break the sentence in individual dictionary words. - * - * @author [Anushka Verma](https://github.com/verma-anushka) - */ - -#include -using namespace std; - -/** - * Utility function - */ -void wordbreak(string s, vector& dict, int i, string ans) { - - string word=s.substr(0, i+1); - int ws=s.size(); - - // search for word in the dictionary - if(find(dict.begin(), dict.end(), word) != dict.end()) { - - if(i dict = { "mobile","samsung","sam","sung", - "man","mango","icecream","and", - "go","i","like","ice","cream" }; - string s = "ilikesamsung"; - wordbreak(s, dict, 0, ""); - return 0; -} - -- GitLab