GitHub interview question

One leetcode recursive problem for Oa