Question: For this question you cannot use any Python builtin functions!!! def balanced_strings(s: str) -> str: receives a balanced string and splits it into the
For this question you cannot use any Python builtin functions!!! def balanced_strings(s: str) -> str: """ receives a balanced string and splits it into the maximum possible number of balanced strings and returns that as new string """ Python code here
Test Cases:
test_cases = ( 'aaabbbccc', 'abcabcabc', 'babcCACBCaaB', 'aBcCbA', 'aBc', 'aBcaCbbAcbCacAbcBa', 'aCBBCAbAAcCAcbCBBa', 'bACcACbbACBa', 'CBACcbcabcAaABb' ) for case in test_cases: print(balanced_strings(case))
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
