Frage im Vorstellungsgespräch bei JPMorganChase

Coding question on hacker rank, probably Leetcode easy to medium