Question d’entretien chez Staples

Time/Space complexity of the code