Pregunta de entrevista de MRI Software

Solve some basic sql and javascript problems using loops and sorting.