Implement a stack with push, pop and top operations.
Asked in the Onsite stage. Implement the required behavior using a stack abstraction.
Implement execute_stack_operations(operations). Each operation is ['push', value], ['pop'], or ['top']. Return the results of pop and top operations in order. A push produces no result, and pop or top on an empty stack returns None.
Example 1: [['push', 4], ['push', 9], ['top'], ['pop'], ['top']] returns [9, 9, 4] because the most recently pushed value is removed first.
Example 2: [['pop'], ['push', 2], ['top'], ['pop'], ['pop']] returns [None, 2, 2, None].
def execute_stack_operations(operations):