JPMorganChase interview question

Gave 2 leetcode problems. One easy and one medium