Frage im Vorstellungsgespräch bei ChannelWorks

Algorithm time complexity and its code snippet in javascript or typescript