From 442f48d9398e79e38ceff6d23dc974fca691c850 Mon Sep 17 00:00:00 2001 From: AmritaGup <86473686+AmritaGup@users.noreply.github.com> Date: Tue, 25 Oct 2022 23:25:09 +0530 Subject: [PATCH] Palindrome partitioning --- CPP DSA/14_palindromepartioning.cpp | 34 +++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 CPP DSA/14_palindromepartioning.cpp diff --git a/CPP DSA/14_palindromepartioning.cpp b/CPP DSA/14_palindromepartioning.cpp new file mode 100644 index 0000000..9e985bb --- /dev/null +++ b/CPP DSA/14_palindromepartioning.cpp @@ -0,0 +1,34 @@ +#include +#include +using namespace std; +bool isPalindrome(string s, int start, int end){ + while(start<=end){ + if(s[start++]!=s[end--]){ + return false; + } + } + return true; +} +void solve(string s, vectorout, int idx){ + if(idx==s.size()){ + for(auto it:out){ + cout<out; + int idx=0; + solve(s,out,idx); + +} \ No newline at end of file