Pregunta de entrevista de Wells Fargo

coding problem is related to "Selling Products" — Minimize distinct IDs