Frage im Vorstellungsgespräch bei Tata Consultancy Services

Two pointers problem with time complexity