SLB interview question

Complexities - time and space complexity