JPMorganChase interview question

Simple easy recursive leetcode question and array question