Implemented exercise 3.1 - Use a single array to implement three stacks.