SLB interview question

Data structure and algorithms, time and space complexity