Question d’entretien chez Netwealth Investments

Leetcode easy level programming question, be prepared to explain the time complexity of your solution