Sigma Computing Interview Question

What's the time complexity of xx function. How to improve.