Pergunta de entrevista da empresa Plus500

I was asked to complete a home assignment with LeetCode-style coding questions.