NeetCode #803LC-1653MediumGreedy
← Back to All Problems

#803 · #1653 · Minimum Deletions to Make String Balanced(使字符串平衡的最少删除次数)

📌 Problem Statement & Constraints

You are given a string s of a and b. A string is balanced if no a appears after a b. In one deletion you may remove any character. Return the minimum deletions to make s balanced. 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!