Why do I get a Time Limit Exceeded?

,

y i m getting TLE in my code can anyone help


[1] 
please help 
[Problem set][2]


  [1]: https://www.codechef.com/viewsolution/17096612
  [2]: https://www.codechef.com/FLMOCK02/problems/STACKS/