Check if all array elements can be removed by the given operations | Function to check if it is possible to remove all array elements ; Condition if we can remove all elements from the array ; Driver code
def removeAll ( arr , n ) : NEW_LINE INDENT if arr [ 0 ] < arr [ n - 1 ] : NEW_LINE INDENT print ( " YES " ) NEW_LINE DEDENT else : NEW_LINE INDENT print ( " NO " ) NEW_LINE DEDENT DEDENT arr = [ 10 , 4 , 7 , 1 , 3 , 6 ] NEW_LINE removeAll ( arr , len ( arr ) ) NEW_LINE