Laufengd_HW_01

I don't think this is what the author was getting at. If you do a push when you see a +1, and a pop when you see a -1, then you have a Dyck word if and only if you never tried to pop when the stack was empty.