Question d’entretien chez CVS Health

Time complexity and space complexity of my code