Question d’entretien chez Squarepoint Capital

Hackerrank question is medium difficulty