From ac21c513976cfa2d284e83b5b4f44a4168a32156 Mon Sep 17 00:00:00 2001 From: AmritaGup <86473686+AmritaGup@users.noreply.github.com> Date: Wed, 26 Oct 2022 16:07:12 +0530 Subject: [PATCH] Palindromic partitioning cpp --- C++/14_palindromepartioning.cpp | 34 +++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 C++/14_palindromepartioning.cpp diff --git a/C++/14_palindromepartioning.cpp b/C++/14_palindromepartioning.cpp new file mode 100644 index 0000000..9e985bb --- /dev/null +++ b/C++/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