Question d’entretien chez OneSoil

At coding interview I was asked to solve a medium difficulty level algorithmic task.