1246. Palindrome Removal
https://leetcode.com/problems/palindrome-removal
Description
Given an integer array arr
, in one move you can select a palindromic subarray arr[i], arr[i+1], ..., arr[j]
where i <= j
, and remove that subarray from the given array. Note that after removing a subarray, the elements on the left and on the right of that subarray move to fill the gap left by the removal.
Return the minimum number of moves needed to remove all numbers from the array.
Example 1:
Example 2:
Constraints:
1 <= arr.length <= 100
1 <= arr[i] <= 20
ac
Last updated