If current element is greater than the top element of track stack , append the current element to track stack otherwise append the element at top of track stack again into it .
if ( x > self . trackStack [ - 1 ] ) : NEW_LINE INDENT self . trackStack . append ( x ) NEW_LINE DEDENT else : NEW_LINE INDENT self . trackStack . append ( self . trackStack [ - 1 ] ) NEW_LINE DEDENT def getMax ( self ) : NEW_LINE return self . trackStack [ - 1 ] NEW_LINE def pop ( self ) : NEW_LINE self . mainStack . pop ( ) NEW_LINE self . trackStack . pop ( ) NEW_LINE