Partially implement the three stacks in an array problem, but there are some corner cases remain unresolved yet.