Company: Scaler SDE intern OA_16feb
Difficulty: medium
Palindrome Partitioning II body { font-family: sans-serif; line-height: 1.6; margin: 20px; } h1 { color: #333; } h2 { color: #555; border-bottom: 1px solid #eee; padding-bottom: 5px; margin-top: 30px; } pre { background-color: #f4f4f4; padding: 10px; border-radius: 5px; overflow-x: auto; } code { font-family: monospace; } .example-section { margin-bottom: 20px; } Palindrome Partitioning II Problem Description Given a string A, partition A such that every substring of the partition is a palindrome. Return the minimum cuts needed for a palindrome partitioning of A. Problem Constraints 1 Input Format The first and the only argument contains the string A. Output Format Return an integer, representing the minimum cuts needed. Example Input Input 1: A = "aba" Input 2: A = "aab" Example Output Output 1: 0 Output 2: 1 Example Explanation Explanation 1: "aba" is already a palindrome, so no cuts are needed. Explanation 2: Return 1 since the palindrome partitioning ["aa", "b"] could be produced u