Frage im Vorstellungsgespräch bei Comcast

Asked to write code for algorithm/use inbuilt function and time complexity of it