Video solution | Intuition and Approach explained in detail | C++ | Backtracking
Video\nHello every one i have created a video solution for this problem and solved this video by developing intutition for backtracking (its in hindi), i am pre
# Video\nHello every one i have created a video solution for this problem and solved this video by developing intutition for backtracking (its in hindi), i am pretty sure you will never have to look for solution for this video ever again after watching this.\n\n\nThis video is the part of my playlist "Master backtracking".\nVideo Link: \n\nhttps://www.youtube.com/watch?v=Dk3QDMRc8vQ\n\n# Code\n```\nclass Solution {\n    long  ans = 0;\n\n    bool isPal(string &s)\n    {\n        int start=0, end = s.length()-1;\n        while(start < end)\n        {\n            if(s[start] != s[end]) return false;\n            start++; end--;\n        }\n        return true;\n    }\n        void helper(string &s,int idx,string &s1,string &s2){\n            if(isPal(s1) && isPal(s2)){\n                long temp= (int) s1.length() * s2.length();\n                ans= max(ans, temp);     \n           }\n            for(int i=idx;i<s.size();i++){\n                s1.push_back(s[i]);\n                helper(s,i+1,s1,s2);\n                s1.pop_back();\n\n                s2.push_back(s[i]);\n                helper(s,i+1,s1,s2);\n                s2.pop_back();\n            }\n           return;\n        }\n\npublic:\n    int maxProduct(string s) {\n        string s1="";\n        string s2="";\n        helper(s,0,s1,s2);\n        return ans;\n    }\n};\n```
['C++']