Function to return the minimum operations required
def minOperations ( s , len ) : NEW_LINE INDENT operationCnt = 0 ; NEW_LINE st = LifoQueue ( ) ; NEW_LINE cntClosing = 0 ; NEW_LINE for i in range ( 0 , len ) : NEW_LINE DEDENT