Challenge B: Stack
Declare a generic type Stack. A stack is a LIFO (last-in-first-out) data structure that supports the following operations:
- peek: returns the top element on the stack without removing it. Returns nil if the stack is empty.
- push: adds an element on top of the stack.
- pop: returns and removes the top element on the stack. Returns nil if the stack is empty.
- count: returns the size of the stack.
Ensure that these operations are the only exposed interface. In other words,
additional properties or methods needed to implement the type should not be visible.