Domanda di colloquio di Salesforce

solve an an online algorithm problem in hackerrank