Question: What is the time complexity of clearing all elements from a stack?
Options:
Correct Answer: O(n)
Solution:
Clearing all elements from a stack requires popping each element, leading to a time complexity of O(n).