what to write in the constructor as no variables are given what we need to initialize?
declare the global variables and clear them out in the constructor.
Yes, question is about stacks. But, you need queues for your Solution. Make them your global variable and keep clearing them in your constructor for each test case.