Sponsored
Use these hints if you're stuck. Try solving on your own first.
Consider iterating over each subarray and checking if it’s balanced or not.
Among all balanced subarrays, the answer is the longest one of them.
Solve with full IDE support and test cases