solution for Queue Continuum