C3 AI Interview Question

Time complexity of the code