This is a verified interview question from Visa. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Minimum Length After Deleting Substrings - Visa DTU" covers key patterns like Strings.
"You are given a string seq made up only of the characters 'A' and 'B'. You may repeatedly perform the following operation: - Delete any occurrence of the substring 'AB' or 'BB'. - After deletion, the remaining parts of the string are concatenated. Your task is to determine the minimum possible length of the string after performing any number of valid deletions. Note: A substring refers to a contiguous sequence of characters. Return the minimum remaining length."
Join thousands of developers practicing for Visa.