{"id":"bad70512-29e1-4fab-b495-f4aa5842b072","name":"Minimum Palindromic Cut","description":"1. You are given a string.\r\n2. You have to find the minimum number of cuts required to convert the given string into palindromic partitions.\r\n3. Partitioning of the string is a palindromic partitioning if every substring of the partition is a palindrome.","inputFormat":"A string","outputFormat":"Check the sample output and question video.","constraints":"1 <= length of string <= 10^4","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n\tpublic static int minPalindromicCut(String s) {\r\n\t\t//write your code here\r\n\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tString str = scn.nextLine();\r\n\t\tSystem.out.println(minPalindromicCut(str));\r\n\t}\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"abccbc","sampleOutput":"2\r\n","questionVideo":"https://www.youtube.com/embed/qmTtAbOTqcg?end=65","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"5539a6e8-c8bf-4f04-805c-e43e9d20e72a","name":"Dynamic Programming For Intermediate","slug":"dynamic-programming-for-intermediate-408","type":0},{"id":"20c33532-68ee-4b4b-8d10-998bbc9bcafc","name":"Minimum Palindromic Cut","slug":"minimum-palindromic-cut","type":1}],"next":{"id":"998b2ea3-174a-4c17-9428-e530d73075c9","name":"MINIMUM PALINDROMIC CUT MCQ","type":0,"slug":"minimum-palindromic-cut-mcq"},"prev":{"id":"86aa9868-4b20-4aab-8efe-8fef7b6c1ff4","name":"Rod Cutting","type":3,"slug":"rod-cutting"}}}

Minimum Palindromic Cut

1. You are given a string. 2. You have to find the minimum number of cuts required to convert the given string into palindromic partitions. 3. Partitioning of the string is a palindromic partitioning if every substring of the partition is a palindrome.

{"id":"bad70512-29e1-4fab-b495-f4aa5842b072","name":"Minimum Palindromic Cut","description":"1. You are given a string.\r\n2. You have to find the minimum number of cuts required to convert the given string into palindromic partitions.\r\n3. Partitioning of the string is a palindromic partitioning if every substring of the partition is a palindrome.","inputFormat":"A string","outputFormat":"Check the sample output and question video.","constraints":"1 <= length of string <= 10^4","sampleCode":{"cpp":{"code":""},"java":{"code":"import java.io.*;\r\nimport java.util.*;\r\n\r\npublic class Main {\r\n\r\n\tpublic static int minPalindromicCut(String s) {\r\n\t\t//write your code here\r\n\r\n\t\treturn 0;\r\n\t}\r\n\r\n\tpublic static void main(String[] args) {\r\n\t\tScanner scn = new Scanner(System.in);\r\n\t\tString str = scn.nextLine();\r\n\t\tSystem.out.println(minPalindromicCut(str));\r\n\t}\r\n}"},"node":{"code":""},"ruby":{"code":""},"python":{"code":""}},"points":10,"difficulty":"easy","sampleInput":"abccbc","sampleOutput":"2\r\n","questionVideo":"https://www.youtube.com/embed/qmTtAbOTqcg?end=65","hints":[],"associated":[],"solutionSeen":false,"tags":[],"meta":{"path":[{"id":0,"name":"home"},{"id":"0c54b191-7b99-4f2c-acb3-e7f2ec748b2a","name":"Data Structures and Algorithms","slug":"data-structures-and-algorithms","type":0},{"id":"5539a6e8-c8bf-4f04-805c-e43e9d20e72a","name":"Dynamic Programming For Intermediate","slug":"dynamic-programming-for-intermediate-408","type":0},{"id":"20c33532-68ee-4b4b-8d10-998bbc9bcafc","name":"Minimum Palindromic Cut","slug":"minimum-palindromic-cut","type":1}],"next":{"id":"998b2ea3-174a-4c17-9428-e530d73075c9","name":"MINIMUM PALINDROMIC CUT MCQ","type":0,"slug":"minimum-palindromic-cut-mcq"},"prev":{"id":"86aa9868-4b20-4aab-8efe-8fef7b6c1ff4","name":"Rod Cutting","type":3,"slug":"rod-cutting"}}}
plane

Editor


Loading...

Minimum Palindromic Cut

easy

1. You are given a string. 2. You have to find the minimum number of cuts required to convert the given string into palindromic partitions. 3. Partitioning of the string is a palindromic partitioning if every substring of the partition is a palindrome.

Constraints

1 <= length of string <= 10^4

Format

Input

A string

Output

Check the sample output and question video.

Example

Sample Input

abccbc

Sample Output

2

Question Video

Discussions

Show Discussion

Related Resources

related resources

Turning Off Zen Mode