Frage im Vorstellungsgespräch bei Thomson Reuters

Coding question on hackerrank, then asked for time/space complexity