4 ms·
No, he checks each time through the loop to see if the counter ever goes below zero; if it does, then the string is unbalanced.
by db48x 8y ago
No, he checks each time through the loop to see if the counter ever goes below zero; if it does, then the string is unbalanced.