Pregunta de entrevista de Go Digital Technology Consulting

Basic sql question on hacckerrank. Python was tricky.