Scopely interview question

Algorithm, Time Complexity, Coding, Sorting,