Zalando Interview Question

Whats code time complexity? How can it be improved?