Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Non-overlapping Palindrome Substrings

Try to solve the Maximum Number of Non-overlapping Palindrome Substrings problem.

Statement

Given a string s and a positive integer k, select the maximum number of non overlapping substrings such that each selected substring is a palindrome with a length of at least k.

Return the maximum number of such substrings that can be chosen.

Note: A substring is a contiguous sequence of characters within a string. A palindrome is a string that reads the same backward as forward. Substrings are non overlapping if they do not share any common indices.

Constraints:

  • 1≤1 \leq k ≤\leq s.length ≤2000\leq 2000

  • s consists of lowercase English letters.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Maximum Number of Non-overlapping Palindrome Substrings

Try to solve the Maximum Number of Non-overlapping Palindrome Substrings problem.

Statement

Given a string s and a positive integer k, select the maximum number of non overlapping substrings such that each selected substring is a palindrome with a length of at least k.

Return the maximum number of such substrings that can be chosen.

Note: A substring is a contiguous sequence of characters within a string. A palindrome is a string that reads the same backward as forward. Substrings are non overlapping if they do not share any common indices.

Constraints:

  • 1≤1 \leq k ≤\leq s.length ≤2000\leq 2000

  • s consists of lowercase English letters.