diff --git a/Palindromic Partitioning.cpp b/Palindromic Partitioning.cpp new file mode 100644 index 0000000..de61f55 --- /dev/null +++ b/Palindromic Partitioning.cpp @@ -0,0 +1,33 @@ +// User function Template for C++ + +class Solution{ +public: + bool isPalindrome(int i, int j, string& str) { + while(i&dp) { + if(i==n) { + return 0; + } + int mini = INT_MAX; + if(dp[i]!=-1) return dp[i]; + + for(int j = i; jdp(n,-1); + return solve(0,n,str,dp)-1; + } +};