Free written solutionMinimum Length of String After Operations (LeetCode 3223): Solution and Explanation
You may repeatedly pick a character that has a copy of itself on both sides and delete the nearest copy on each side. Return the shortest length the string can reach.
Read the intuition, approach, code and complexity →