JPMorgan Chase logoJPMorgan Chase
CodingMembers

AB / BB Substring Deletion OA

Members only

Given a string of only 'A' and 'B', repeatedly delete any occurrence of "AB" or "BB" and return the minimum achievable length; n up to 2*10^5. Every 'B' with any character before it can be removed, so...

SWE
string
stack
greedy
oa
easy
Frequency
Single report
Last asked
2026-10-03
Stage
oa

Log in to continue reading the full content

Comments

Sign in to join the discussion
Loading...