GlobalLogic Interview Question

Algorithms and questions regarding time and space complexity