3223. Minimum Length of String After Operations
You are given a string
s.You can perform the following process on
sany number of times:
- Choose an index
iin the string such that there is at least one character to the left of indexithat is equal tos[i], and at least one character to the right that is also equal tos[i].- Delete the closest character to the left of index
ithat is equal tos[i].- Delete the closest character to the right of index
ithat is equal tos[i].Return the minimum length of the final string
sthat you can achieve.
1 |
|