Luxoft Interview Question

Complexity, big O notation