Solution for stacks
heap