Solution to implementation of Stack interface for CodeEval challenge