You are viewing a single comment's thread. Return to all comments →
I pass only 2 test cases out of 28. What is wrong?
pushed_elements = [] operation_tuples = [tuple(operations[i].split()) for i in range(len(operations))] for o in operation_tuples: if o[0] == '1': pushed_elements.append(int(o[1])) elif o[0] == '2': reversed_pushed_el = pushed_elements[::-1] el_to_remove = reversed_pushed_el[0] pushed_elements.remove(el_to_remove) else: max(pushed_elements)
Seems like cookies are disabled on this browser, please enable them to open this website
Maximum Element
You are viewing a single comment's thread. Return to all comments →
I pass only 2 test cases out of 28. What is wrong?