Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
Palindrome Partitioning Cuts
00:00
5 left

Palindrome Partitioning Cuts

HardPython

Problem

Given a string s, partition s such that every substring of the partition is a palindrome; return the minimum cuts needed for a palindrome partitioning of s.

Implement min_cut(s), where s is a string and the result is an integer. A string containing no characters requires zero cuts.

Constraints

  • 0 <= len(s) <= 2000
  • s contains lowercase English letters

Function Signature

def min_cut(s):
Interviewer

Your question is Palindrome Partitioning Cuts. Start with the requirements in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePython 3
You need to log in / sign up to run or submit.Ln 2
Run your code to see test output here.