New Work SE interview question

1. Time complexity of the implemented algorithm.