AndurilSoftware Engineer · Take-home ProjectCodemia practiceImplement Stack with O(n) time
Implement a stack data structure that supports push, pop, and top operations, ensuring that each operation runs in O(n) time. The stack should be able to handle integer values, and you should provide methods to retrieve the top element without removing it. Additionally, ensure that the stack can be cleared, resetting its state.