JPMorganChase Interview Question

Leetcode easy, nothing difficult really