JPMorganChase Interview Question

Simple easy recursive leetcode question and array question