If substring ( st , i ) is balanced
if ( balanced ( small , caps ) ) : NEW_LINE INDENT if ( minm > ( i - st + 1 ) ) : NEW_LINE INDENT minm = i - st + 1 NEW_LINE start = st NEW_LINE end = i NEW_LINE DEDENT DEDENT i += 1 NEW_LINE