Question d’entretien chez Meta

Is there any alternative solution to the coding problem? What about its complexity compared to yours?