this is the stack problem that i have solved using golang.