This is a verified interview question from Ion. Candidates reporting seeing this problem in recent Online Assessments (OAs) and onsite rounds. Mastering "Balanced Strings" covers key patterns like Strings.
"You are given an array of strings, each consisting only of the characters '<' and '>'. A string is considered balanced if every individual '<' appears before a unique corresponding '>'. The characters do not need to be adjacent. To balance a string, you are allowed to replace any '>' character with the sequence '<>'. Given an array of strings and a corresponding array of maximum number of replacements you can make for each string, determine whether each string can be balanced. Return an array of 1s and 0s — 1 if the expression can be balanced and 0 otherwise."
Join thousands of developers practicing for Ion.