NeetCode #212LC-1750MediumTwo Pointers
← Back to All Problems#212 · #1750 · Minimum Length of String After Deleting Similar Ends(删除字符串两端相同字符后的最短长度)
📌 Problem Statement & Constraints
Given a string
s consisting only of characters a, b and c, repeatedly delete a prefix and a suffix that both consist of the same character, until no such pair exists. Return the minimum length of the remaining string. Constraints: 1 <= s.length <= 10^5.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!