Tap here to switch tabs
Problem
Submissions

Problem: Palindrome Removal

Palindrome Removal asks you to repeatedly delete palindromic subarrays from an integer array, with the remaining sides joined together, and return the fewest operations needed to remove everything.

Statement

Given an integer array arr, in each operation you can choose a palindromic subarray and remove it from arr. Once a subarray is removed, the remaining elements to its left and right are concatenated to form a single array.

Return the minimum number of operations required to completely remove all elements from arr.

Constraints:

  • 1≤1 \leq arr.length ≤100\leq 100

  • 1≤1 \leq arr[i] ≤20\leq 20

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Palindrome Removal

Palindrome Removal asks you to repeatedly delete palindromic subarrays from an integer array, with the remaining sides joined together, and return the fewest operations needed to remove everything.

Statement

Given an integer array arr, in each operation you can choose a palindromic subarray and remove it from arr. Once a subarray is removed, the remaining elements to its left and right are concatenated to form a single array.

Return the minimum number of operations required to completely remove all elements from arr.

Constraints:

  • 1≤1 \leq arr.length ≤100\leq 100

  • 1≤1 \leq arr[i] ≤20\leq 20