Hul Hub Interview Question

Like matching patterns question based on stack queue