Frage im Vorstellungsgespräch bei JPMorganChase

Hackerrank question with easy and medium Leetcode problems.