1750. Minimum Length of String After Deleting Similar Ends
Description
**Input:** s = "ca"
**Output:** 2
**Explanation:** You can't remove any characters, so the string stays as is.**Input:** s = "cabaabac"
**Output:** 0
**Explanation:** An optimal sequence of operations is:
- Take prefix = "c" and suffix = "c" and remove them, s = "abaaba".
- Take prefix = "a" and suffix = "a" and remove them, s = "baab".
- Take prefix = "b" and suffix = "b" and remove them, s = "aa".
- Take prefix = "a" and suffix = "a" and remove them, s = "".ac
Previous1749. Maximum Absolute Sum of Any SubarrayNext1751. Maximum Number of Events That Can Be Attended II
Last updated