JPMorganChase interview question

Leetcode easy, nothing difficult really