Added the solution for stack0