Amazon interview question

q1. Implement stack q2. Printing brackets in Matrix Chain Multiplication Problem