1750. Minimum Length of String After Deleting Similar Ends (Leetcode Medium)