Pregunta de entrevista de Expedia Group

priority queue question it was easy